| 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_window_tree_host_win.h" | 5 #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // DesktopThemeProvider maps resource ids using MapThemeImage(). This is | 32 // DesktopThemeProvider maps resource ids using MapThemeImage(). This is |
| 33 // necessary for BrowserDesktopWindowTreeHostWin so that it uses the windows | 33 // necessary for BrowserDesktopWindowTreeHostWin so that it uses the windows |
| 34 // theme images rather than the ash theme images. | 34 // theme images rather than the ash theme images. |
| 35 class DesktopThemeProvider : public ui::ThemeProvider { | 35 class DesktopThemeProvider : public ui::ThemeProvider { |
| 36 public: | 36 public: |
| 37 explicit DesktopThemeProvider(ui::ThemeProvider* delegate) | 37 explicit DesktopThemeProvider(ui::ThemeProvider* delegate) |
| 38 : delegate_(delegate) { | 38 : delegate_(delegate) { |
| 39 } | 39 } |
| 40 | 40 |
| 41 virtual bool UsingSystemTheme() const OVERRIDE { | 41 virtual bool UsingSystemTheme() const override { |
| 42 return delegate_->UsingSystemTheme(); | 42 return delegate_->UsingSystemTheme(); |
| 43 } | 43 } |
| 44 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE { | 44 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const override { |
| 45 return delegate_->GetImageSkiaNamed( | 45 return delegate_->GetImageSkiaNamed( |
| 46 chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id)); | 46 chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id)); |
| 47 } | 47 } |
| 48 virtual SkColor GetColor(int id) const OVERRIDE { | 48 virtual SkColor GetColor(int id) const override { |
| 49 return delegate_->GetColor(id); | 49 return delegate_->GetColor(id); |
| 50 } | 50 } |
| 51 virtual int GetDisplayProperty(int id) const OVERRIDE { | 51 virtual int GetDisplayProperty(int id) const override { |
| 52 return delegate_->GetDisplayProperty(id); | 52 return delegate_->GetDisplayProperty(id); |
| 53 } | 53 } |
| 54 virtual bool ShouldUseNativeFrame() const OVERRIDE { | 54 virtual bool ShouldUseNativeFrame() const override { |
| 55 return delegate_->ShouldUseNativeFrame(); | 55 return delegate_->ShouldUseNativeFrame(); |
| 56 } | 56 } |
| 57 virtual bool HasCustomImage(int id) const OVERRIDE { | 57 virtual bool HasCustomImage(int id) const override { |
| 58 return delegate_->HasCustomImage( | 58 return delegate_->HasCustomImage( |
| 59 chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id)); | 59 chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id)); |
| 60 } | 60 } |
| 61 virtual base::RefCountedMemory* GetRawData( | 61 virtual base::RefCountedMemory* GetRawData( |
| 62 int id, | 62 int id, |
| 63 ui::ScaleFactor scale_factor) const OVERRIDE { | 63 ui::ScaleFactor scale_factor) const override { |
| 64 return delegate_->GetRawData(id, scale_factor); | 64 return delegate_->GetRawData(id, scale_factor); |
| 65 } | 65 } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 ui::ThemeProvider* delegate_; | 68 ui::ThemeProvider* delegate_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(DesktopThemeProvider); | 70 DISALLOW_COPY_AND_ASSIGN(DesktopThemeProvider); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( | 326 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( |
| 327 views::internal::NativeWidgetDelegate* native_widget_delegate, | 327 views::internal::NativeWidgetDelegate* native_widget_delegate, |
| 328 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 328 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 329 BrowserView* browser_view, | 329 BrowserView* browser_view, |
| 330 BrowserFrame* browser_frame) { | 330 BrowserFrame* browser_frame) { |
| 331 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, | 331 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, |
| 332 desktop_native_widget_aura, | 332 desktop_native_widget_aura, |
| 333 browser_view, | 333 browser_view, |
| 334 browser_frame); | 334 browser_frame); |
| 335 } | 335 } |
| OLD | NEW |