| 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 605 |
| 606 WebContents* BrowserView::GetActiveWebContents() const { | 606 WebContents* BrowserView::GetActiveWebContents() const { |
| 607 return browser_->tab_strip_model()->GetActiveWebContents(); | 607 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 608 } | 608 } |
| 609 | 609 |
| 610 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { | 610 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { |
| 611 return *GetThemeProvider()->GetImageSkiaNamed(GetOTRIconResourceID()); | 611 return *GetThemeProvider()->GetImageSkiaNamed(GetOTRIconResourceID()); |
| 612 } | 612 } |
| 613 | 613 |
| 614 bool BrowserView::IsPositionInWindowCaption(const gfx::Point& point) { | 614 bool BrowserView::IsPositionInWindowCaption(const gfx::Point& point) { |
| 615 if (window_switcher_button_) { | |
| 616 gfx::Point window_switcher_point(point); | |
| 617 views::View::ConvertPointToTarget(this, window_switcher_button_, | |
| 618 &window_switcher_point); | |
| 619 if (window_switcher_button_->HitTestPoint(window_switcher_point)) | |
| 620 return false; | |
| 621 } | |
| 622 return GetBrowserViewLayout()->IsPositionInWindowCaption(point); | 615 return GetBrowserViewLayout()->IsPositionInWindowCaption(point); |
| 623 } | 616 } |
| 624 | 617 |
| 625 /////////////////////////////////////////////////////////////////////////////// | 618 /////////////////////////////////////////////////////////////////////////////// |
| 626 // BrowserView, BrowserWindow implementation: | 619 // BrowserView, BrowserWindow implementation: |
| 627 | 620 |
| 628 void BrowserView::Show() { | 621 void BrowserView::Show() { |
| 629 // If the window is already visible, just activate it. | 622 // If the window is already visible, just activate it. |
| 630 if (frame_->IsVisible()) { | 623 if (frame_->IsVisible()) { |
| 631 frame_->Activate(); | 624 frame_->Activate(); |
| (...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2741 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2734 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2742 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2735 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2743 LocationBarView::kIconInternalPadding + 1); | 2736 LocationBarView::kIconInternalPadding + 1); |
| 2744 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2737 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2745 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2738 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2746 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2739 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2747 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2740 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2748 } | 2741 } |
| 2749 return top_arrow_height; | 2742 return top_arrow_height; |
| 2750 } | 2743 } |
| OLD | NEW |