| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 g_browser_process->profile_manager()->GetProfileInfoCache(); | 564 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 565 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == | 565 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == |
| 566 std::string::npos) { | 566 std::string::npos) { |
| 567 return false; | 567 return false; |
| 568 } | 568 } |
| 569 | 569 |
| 570 return AvatarMenu::ShouldShowAvatarMenu(); | 570 return AvatarMenu::ShouldShowAvatarMenu(); |
| 571 #endif | 571 #endif |
| 572 } | 572 } |
| 573 | 573 |
| 574 bool BrowserView::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { | 574 bool BrowserView::GetAccelerator(int cmd_id, |
| 575 ui::Accelerator* accelerator) const { |
| 575 // We retrieve the accelerator information for standard accelerators | 576 // We retrieve the accelerator information for standard accelerators |
| 576 // for cut, copy and paste. | 577 // for cut, copy and paste. |
| 577 if (chrome::GetStandardAcceleratorForCommandId(cmd_id, accelerator)) | 578 if (chrome::GetStandardAcceleratorForCommandId(cmd_id, accelerator)) |
| 578 return true; | 579 return true; |
| 579 // Else, we retrieve the accelerator information from the accelerator table. | 580 // Else, we retrieve the accelerator information from the accelerator table. |
| 580 for (std::map<ui::Accelerator, int>::const_iterator it = | 581 for (std::map<ui::Accelerator, int>::const_iterator it = |
| 581 accelerator_table_.begin(); it != accelerator_table_.end(); ++it) { | 582 accelerator_table_.begin(); it != accelerator_table_.end(); ++it) { |
| 582 if (it->second == cmd_id) { | 583 if (it->second == cmd_id) { |
| 583 *accelerator = it->first; | 584 *accelerator = it->first; |
| 584 return true; | 585 return true; |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 chrome::NOTIFICATION_WINDOW_CLOSED, | 1757 chrome::NOTIFICATION_WINDOW_CLOSED, |
| 1757 content::Source<gfx::NativeWindow>(frame_->GetNativeWindow()), | 1758 content::Source<gfx::NativeWindow>(frame_->GetNativeWindow()), |
| 1758 content::NotificationService::NoDetails()); | 1759 content::NotificationService::NoDetails()); |
| 1759 return true; | 1760 return true; |
| 1760 } | 1761 } |
| 1761 | 1762 |
| 1762 int BrowserView::NonClientHitTest(const gfx::Point& point) { | 1763 int BrowserView::NonClientHitTest(const gfx::Point& point) { |
| 1763 return GetBrowserViewLayout()->NonClientHitTest(point); | 1764 return GetBrowserViewLayout()->NonClientHitTest(point); |
| 1764 } | 1765 } |
| 1765 | 1766 |
| 1766 gfx::Size BrowserView::GetMinimumSize() { | 1767 gfx::Size BrowserView::GetMinimumSize() const { |
| 1767 return GetBrowserViewLayout()->GetMinimumSize(); | 1768 return GetBrowserViewLayout()->GetMinimumSize(); |
| 1768 } | 1769 } |
| 1769 | 1770 |
| 1770 /////////////////////////////////////////////////////////////////////////////// | 1771 /////////////////////////////////////////////////////////////////////////////// |
| 1771 // BrowserView, views::View overrides: | 1772 // BrowserView, views::View overrides: |
| 1772 | 1773 |
| 1773 const char* BrowserView::GetClassName() const { | 1774 const char* BrowserView::GetClassName() const { |
| 1774 return kViewClassName; | 1775 return kViewClassName; |
| 1775 } | 1776 } |
| 1776 | 1777 |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2533 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2534 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2534 gfx::Point icon_bottom( | 2535 gfx::Point icon_bottom( |
| 2535 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2536 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2536 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2537 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2537 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2538 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2538 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2539 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2539 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2540 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2540 } | 2541 } |
| 2541 return top_arrow_height; | 2542 return top_arrow_height; |
| 2542 } | 2543 } |
| OLD | NEW |