SAN FRANCISCO — When Marissa Mayer took over as chief executive at Yahoo last summer, she confronted a Silicon Valley campus that was very different from the one she had left at Google.