| Index: chrome/browser/ui/views/frame/browser_frame_win.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/frame/browser_frame_win.cc (revision 85647)
|
| +++ chrome/browser/ui/views/frame/browser_frame_win.cc (working copy)
|
| @@ -13,6 +13,7 @@
|
| #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"
|
| @@ -64,7 +65,7 @@
|
| gfx::Insets BrowserFrameWin::GetClientAreaInsets() const {
|
| // Use the default client insets for an opaque frame or a glass popup/app
|
| // frame.
|
| - if (!GetWindow()->non_client_view()->UseNativeFrame() ||
|
| + if (!GetWindow()->ShouldUseNativeFrame() ||
|
| !browser_view_->IsBrowserTypeNormal()) {
|
| return WindowWin::GetClientAreaInsets();
|
| }
|
| @@ -119,6 +120,24 @@
|
| 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:
|
|
|
| @@ -151,7 +170,7 @@
|
|
|
| void BrowserFrameWin::UpdateDWMFrame() {
|
| // Nothing to do yet, or we're not showing a DWM frame.
|
| - if (!GetWindow()->client_view() || !browser_frame_->AlwaysUseNativeFrame())
|
| + if (!GetWindow()->client_view() || !browser_frame_->ShouldUseNativeFrame())
|
| return;
|
|
|
| MARGINS margins = { 0 };
|
|
|