| 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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 // If we do find there are cases where we need to restore the focus on show, | 688 // If we do find there are cases where we need to restore the focus on show, |
| 689 // that should be added and this should be removed. | 689 // that should be added and this should be removed. |
| 690 RestoreFocus(); | 690 RestoreFocus(); |
| 691 | 691 |
| 692 frame_->Show(); | 692 frame_->Show(); |
| 693 | 693 |
| 694 force_location_bar_focus_ = false; | 694 force_location_bar_focus_ = false; |
| 695 | 695 |
| 696 browser()->OnWindowDidShow(); | 696 browser()->OnWindowDidShow(); |
| 697 | 697 |
| 698 chrome::MaybeShowInvertBubbleView(browser_.get(), contents_container_); | 698 chrome::MaybeShowInvertBubbleView(this); |
| 699 } | 699 } |
| 700 | 700 |
| 701 void BrowserView::ShowInactive() { | 701 void BrowserView::ShowInactive() { |
| 702 if (frame_->IsVisible()) | 702 if (!frame_->IsVisible()) |
| 703 return; | 703 frame_->ShowInactive(); |
| 704 frame_->ShowInactive(); | |
| 705 } | 704 } |
| 706 | 705 |
| 707 void BrowserView::Hide() { | 706 void BrowserView::Hide() { |
| 708 // Not implemented. | 707 // Not implemented. |
| 709 } | 708 } |
| 710 | 709 |
| 711 void BrowserView::SetBounds(const gfx::Rect& bounds) { | 710 void BrowserView::SetBounds(const gfx::Rect& bounds) { |
| 712 ExitFullscreen(); | 711 ExitFullscreen(); |
| 713 GetWidget()->SetBounds(bounds); | 712 GetWidget()->SetBounds(bounds); |
| 714 } | 713 } |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 bool BrowserView::DrawInfoBarArrows(int* x) const { | 1917 bool BrowserView::DrawInfoBarArrows(int* x) const { |
| 1919 if (x) { | 1918 if (x) { |
| 1920 gfx::Point anchor(toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 1919 gfx::Point anchor(toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 1921 ConvertPointToTarget(toolbar_->location_bar(), this, &anchor); | 1920 ConvertPointToTarget(toolbar_->location_bar(), this, &anchor); |
| 1922 *x = anchor.x(); | 1921 *x = anchor.x(); |
| 1923 } | 1922 } |
| 1924 return true; | 1923 return true; |
| 1925 } | 1924 } |
| 1926 | 1925 |
| 1927 void BrowserView::OnSysColorChange() { | 1926 void BrowserView::OnSysColorChange() { |
| 1928 chrome::MaybeShowInvertBubbleView(browser_.get(), contents_container_); | 1927 chrome::MaybeShowInvertBubbleView(this); |
| 1929 } | 1928 } |
| 1930 | 1929 |
| 1931 void BrowserView::InitViews() { | 1930 void BrowserView::InitViews() { |
| 1932 GetWidget()->AddObserver(this); | 1931 GetWidget()->AddObserver(this); |
| 1933 | 1932 |
| 1934 // Stow a pointer to this object onto the window handle so that we can get at | 1933 // Stow a pointer to this object onto the window handle so that we can get at |
| 1935 // it later when all we have is a native view. | 1934 // it later when all we have is a native view. |
| 1936 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); | 1935 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); |
| 1937 | 1936 |
| 1938 // Stow a pointer to the browser's profile onto the window handle so that we | 1937 // Stow a pointer to the browser's profile onto the window handle so that we |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2575 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2577 gfx::Point icon_bottom( | 2576 gfx::Point icon_bottom( |
| 2578 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2577 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2579 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2578 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2580 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2579 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2581 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2580 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2582 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2581 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2583 } | 2582 } |
| 2584 return top_arrow_height; | 2583 return top_arrow_height; |
| 2585 } | 2584 } |
| OLD | NEW |