| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_desktop_root_window_host_win.h" | 5 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 | 8 |
| 9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (!browser_view_->IsBrowserTypeNormal() && | 246 if (!browser_view_->IsBrowserTypeNormal() && |
| 247 !DesktopWindowTreeHostWin::IsUsingCustomFrame()) { | 247 !DesktopWindowTreeHostWin::IsUsingCustomFrame()) { |
| 248 return false; | 248 return false; |
| 249 } | 249 } |
| 250 | 250 |
| 251 // Otherwise, we use the native frame when we're told we should by the theme | 251 // Otherwise, we use the native frame when we're told we should by the theme |
| 252 // provider (e.g. no custom theme is active). | 252 // provider (e.g. no custom theme is active). |
| 253 return !GetWidget()->GetThemeProvider()->ShouldUseNativeFrame(); | 253 return !GetWidget()->GetThemeProvider()->ShouldUseNativeFrame(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool BrowserDesktopWindowTreeHostWin::ShouldUseNativeFrame() { | 256 bool BrowserDesktopWindowTreeHostWin::ShouldUseNativeFrame() const { |
| 257 if (!views::DesktopWindowTreeHostWin::ShouldUseNativeFrame()) | 257 if (!views::DesktopWindowTreeHostWin::ShouldUseNativeFrame()) |
| 258 return false; | 258 return false; |
| 259 // This function can get called when the Browser window is closed i.e. in the | 259 // This function can get called when the Browser window is closed i.e. in the |
| 260 // context of the BrowserView destructor. | 260 // context of the BrowserView destructor. |
| 261 if (!browser_view_->browser()) | 261 if (!browser_view_->browser()) |
| 262 return false; | 262 return false; |
| 263 return chrome::ShouldUseNativeFrame(browser_view_, | 263 return chrome::ShouldUseNativeFrame(browser_view_, |
| 264 GetWidget()->GetThemeProvider()); | 264 GetWidget()->GetThemeProvider()); |
| 265 } | 265 } |
| 266 | 266 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( | 325 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( |
| 326 views::internal::NativeWidgetDelegate* native_widget_delegate, | 326 views::internal::NativeWidgetDelegate* native_widget_delegate, |
| 327 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 327 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 328 BrowserView* browser_view, | 328 BrowserView* browser_view, |
| 329 BrowserFrame* browser_frame) { | 329 BrowserFrame* browser_frame) { |
| 330 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, | 330 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, |
| 331 desktop_native_widget_aura, | 331 desktop_native_widget_aura, |
| 332 browser_view, | 332 browser_view, |
| 333 browser_frame); | 333 browser_frame); |
| 334 } | 334 } |
| OLD | NEW |