Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(835)

Unified Diff: chrome/browser/ui/views/frame/browser_frame_win.cc

Issue 6975037: Revert 85666 - Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_frame_win.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_frame_win.cc (revision 85701)
+++ chrome/browser/ui/views/frame/browser_frame_win.cc (working copy)
@@ -13,7 +13,6 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "grit/theme_resources.h"
-#include "ui/base/theme_provider.h"
#include "ui/gfx/font.h"
#include "views/screen.h"
#include "views/window/non_client_view.h"
@@ -65,7 +64,7 @@
gfx::Insets BrowserFrameWin::GetClientAreaInsets() const {
// Use the default client insets for an opaque frame or a glass popup/app
// frame.
- if (!GetWindow()->ShouldUseNativeFrame() ||
+ if (!GetWindow()->non_client_view()->UseNativeFrame() ||
!browser_view_->IsBrowserTypeNormal()) {
return WindowWin::GetClientAreaInsets();
}
@@ -120,24 +119,6 @@
WindowWin::OnScreenReaderDetected();
}
-bool BrowserFrameWin::ShouldUseNativeFrame() const {
- // App panel windows draw their own frame.
- if (browser_view_->IsBrowserTypePanel())
- return false;
-
- // We don't theme popup or app windows, so regardless of whether or not a
- // theme is active for normal browser windows, we don't want to use the custom
- // frame for popups/apps.
- if (!browser_view_->IsBrowserTypeNormal() &&
- WindowWin::ShouldUseNativeFrame()) {
- return true;
- }
-
- // Otherwise, we use the native frame when we're told we should by the theme
- // provider (e.g. no custom theme is active).
- return GetWidget()->GetThemeProvider()->ShouldUseNativeFrame();
-}
-
////////////////////////////////////////////////////////////////////////////////
// BrowserFrameWin, NativeBrowserFrame implementation:
@@ -170,7 +151,7 @@
void BrowserFrameWin::UpdateDWMFrame() {
// Nothing to do yet, or we're not showing a DWM frame.
- if (!GetWindow()->client_view() || !browser_frame_->ShouldUseNativeFrame())
+ if (!GetWindow()->client_view() || !browser_frame_->AlwaysUseNativeFrame())
return;
MARGINS margins = { 0 };

Powered by Google App Engine
This is Rietveld 408576698