From 41b946d3b39411c505f66a9dba6dc052d80dde88 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Wed, 18 May 2011 00:15:37 +0000 Subject: Revert 85666 - Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. Now there is: ... window::ShouldUseNativeFrame() Which is basically just a pass-thru to WindowWin::ShouldUseNativeFrame() ... which can be overridden by subclasses. Native-Frame is a windows-only concept but keeping the API on Window means I don't have to update a lot of call sites. Window also gains a FrameType state member that toggles three states - default, force-native and force-custom. This supercedes the "AlwaysUseNativeFrame/AlwaysUseCustomFrame" methods on NonClientView. I have also hooked up a context menu item behind a command line flag --debug-enable-frame-toggle that allows the frame type for an individual window to be toggled, useful for debugging. BUG=none TEST=none Review URL: http://codereview.chromium.org/7036014 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/6975037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85702 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/views/toolbar_view.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chrome/browser/ui/views/toolbar_view.cc') diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index adc3786b..b45c46a 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -466,7 +466,7 @@ gfx::Size ToolbarView::GetPreferredSize() { } int vertical_spacing = PopupTopSpacing() + - (GetWindow()->ShouldUseNativeFrame() ? + (GetWindow()->non_client_view()->UseNativeFrame() ? kPopupBottomSpacingGlass : kPopupBottomSpacingNonGlass); return gfx::Size(0, location_bar_->GetPreferredSize().height() + vertical_spacing); @@ -566,7 +566,7 @@ void ToolbarView::OnPaint(gfx::Canvas* canvas) { // it from the content area. For non-glass, the NonClientView draws the // toolbar background below the location bar for us. // NOTE: Keep this in sync with BrowserView::GetInfoBarSeparatorColor()! - if (GetWindow()->ShouldUseNativeFrame()) + if (GetWindow()->non_client_view()->UseNativeFrame()) canvas->FillRectInt(SK_ColorBLACK, 0, height() - 1, width(), 1); } @@ -646,7 +646,7 @@ int ToolbarView::PopupTopSpacing() const { // it's possible the crash may just show up somewhere else. const views::Window* window = GetWindow(); DCHECK(window) << "If you hit this please talk to beng"; - return window && window->ShouldUseNativeFrame() ? + return window && window->non_client_view()->UseNativeFrame() ? 0 : kPopupTopSpacingNonGlass; } -- cgit v1.1