OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 } | 603 } |
604 #else | 604 #else |
605 if (IsOffTheRecord()) // Desktop guest is incognito and needs avatar. | 605 if (IsOffTheRecord()) // Desktop guest is incognito and needs avatar. |
606 return true; | 606 return true; |
607 #endif | 607 #endif |
608 // Tests may not have a profile manager. | 608 // Tests may not have a profile manager. |
609 if (!g_browser_process->profile_manager()) | 609 if (!g_browser_process->profile_manager()) |
610 return false; | 610 return false; |
611 ProfileInfoCache& cache = | 611 ProfileInfoCache& cache = |
612 g_browser_process->profile_manager()->GetProfileInfoCache(); | 612 g_browser_process->profile_manager()->GetProfileInfoCache(); |
613 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == | 613 |
614 std::string::npos) { | 614 ProfileInfoEntry entry; |
| 615 if (!cache.GetInfoForProfile(browser_->profile()->GetPath(), &entry)) |
615 return false; | 616 return false; |
616 } | |
617 | 617 |
618 return AvatarMenu::ShouldShowAvatarMenu(); | 618 return AvatarMenu::ShouldShowAvatarMenu(); |
619 } | 619 } |
620 | 620 |
621 bool BrowserView::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { | 621 bool BrowserView::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { |
622 // We retrieve the accelerator information for standard accelerators | 622 // We retrieve the accelerator information for standard accelerators |
623 // for cut, copy and paste. | 623 // for cut, copy and paste. |
624 if (chrome::GetStandardAcceleratorForCommandId(cmd_id, accelerator)) | 624 if (chrome::GetStandardAcceleratorForCommandId(cmd_id, accelerator)) |
625 return true; | 625 return true; |
626 // Else, we retrieve the accelerator information from the accelerator table. | 626 // Else, we retrieve the accelerator information from the accelerator table. |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2706 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
2707 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2707 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
2708 LocationBarView::kIconInternalPadding + 1); | 2708 LocationBarView::kIconInternalPadding + 1); |
2709 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2709 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
2710 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2710 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2711 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2711 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2712 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2712 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2713 } | 2713 } |
2714 return top_arrow_height; | 2714 return top_arrow_height; |
2715 } | 2715 } |
OLD | NEW |