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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 604 } |
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) { | |
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); | |
623 } | |
624 | |
625 /////////////////////////////////////////////////////////////////////////////// | 614 /////////////////////////////////////////////////////////////////////////////// |
626 // BrowserView, BrowserWindow implementation: | 615 // BrowserView, BrowserWindow implementation: |
627 | 616 |
628 void BrowserView::Show() { | 617 void BrowserView::Show() { |
629 // If the window is already visible, just activate it. | 618 // If the window is already visible, just activate it. |
630 if (frame_->IsVisible()) { | 619 if (frame_->IsVisible()) { |
631 frame_->Activate(); | 620 frame_->Activate(); |
632 return; | 621 return; |
633 } | 622 } |
634 | 623 |
(...skipping 2106 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. | 2730 // 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() - | 2731 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
2743 LocationBarView::kIconInternalPadding + 1); | 2732 LocationBarView::kIconInternalPadding + 1); |
2744 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2733 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
2745 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2734 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2746 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2735 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2747 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2736 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2748 } | 2737 } |
2749 return top_arrow_height; | 2738 return top_arrow_height; |
2750 } | 2739 } |
OLD | NEW |