| 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 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 virtual void Init(Profile* profile); | 70 virtual void Init(Profile* profile); |
| 71 | 71 |
| 72 // Returns a cross platform image for an id. | 72 // Returns a cross platform image for an id. |
| 73 // | 73 // |
| 74 // TODO(erg): Make this part of the ui::ThemeProvider and the main way to get | 74 // TODO(erg): Make this part of the ui::ThemeProvider and the main way to get |
| 75 // theme properties out of the theme provider since it's cross platform. | 75 // theme properties out of the theme provider since it's cross platform. |
| 76 virtual gfx::Image GetImageNamed(int id) const; | 76 virtual gfx::Image GetImageNamed(int id) const; |
| 77 | 77 |
| 78 // Overridden from ui::ThemeProvider: | 78 // Overridden from ui::ThemeProvider: |
| 79 virtual bool UsingNativeTheme() const OVERRIDE; |
| 79 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE; | 80 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE; |
| 80 virtual SkColor GetColor(int id) const OVERRIDE; | 81 virtual SkColor GetColor(int id) const OVERRIDE; |
| 81 virtual int GetDisplayProperty(int id) const OVERRIDE; | 82 virtual int GetDisplayProperty(int id) const OVERRIDE; |
| 82 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 83 virtual bool ShouldUseNativeFrame() const OVERRIDE; |
| 83 virtual bool HasCustomImage(int id) const OVERRIDE; | 84 virtual bool HasCustomImage(int id) const OVERRIDE; |
| 84 virtual base::RefCountedMemory* GetRawData( | 85 virtual base::RefCountedMemory* GetRawData( |
| 85 int id, | 86 int id, |
| 86 ui::ScaleFactor scale_factor) const OVERRIDE; | 87 ui::ScaleFactor scale_factor) const OVERRIDE; |
| 87 #if defined(OS_MACOSX) | 88 #if defined(OS_MACOSX) |
| 88 virtual NSImage* GetNSImageNamed(int id) const OVERRIDE; | 89 virtual NSImage* GetNSImageNamed(int id) const OVERRIDE; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 virtual void UseDefaultTheme(); | 113 virtual void UseDefaultTheme(); |
| 113 | 114 |
| 114 // Set the current theme to the native theme. On some platforms, the native | 115 // Set the current theme to the native theme. On some platforms, the native |
| 115 // theme is the default theme. | 116 // theme is the default theme. |
| 116 virtual void SetNativeTheme(); | 117 virtual void SetNativeTheme(); |
| 117 | 118 |
| 118 // Whether we're using the chrome default theme. Virtual so linux can check | 119 // Whether we're using the chrome default theme. Virtual so linux can check |
| 119 // if we're using the GTK theme. | 120 // if we're using the GTK theme. |
| 120 virtual bool UsingDefaultTheme() const; | 121 virtual bool UsingDefaultTheme() const; |
| 121 | 122 |
| 122 // Whether we're using the native theme (which may or may not be the | |
| 123 // same as the default theme). | |
| 124 virtual bool UsingNativeTheme() const; | |
| 125 | |
| 126 // Gets the id of the last installed theme. (The theme may have been further | 123 // Gets the id of the last installed theme. (The theme may have been further |
| 127 // locally customized.) | 124 // locally customized.) |
| 128 virtual std::string GetThemeID() const; | 125 virtual std::string GetThemeID() const; |
| 129 | 126 |
| 130 // This class needs to keep track of the number of theme infobars so that we | 127 // This class needs to keep track of the number of theme infobars so that we |
| 131 // clean up unused themes. | 128 // clean up unused themes. |
| 132 void OnInfobarDisplayed(); | 129 void OnInfobarDisplayed(); |
| 133 | 130 |
| 134 // Decrements the number of theme infobars. If the last infobar has been | 131 // Decrements the number of theme infobars. If the last infobar has been |
| 135 // destroyed, uninstalls all themes that aren't the currently selected. | 132 // destroyed, uninstalls all themes that aren't the currently selected. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 content::NotificationRegistrar registrar_; | 259 content::NotificationRegistrar registrar_; |
| 263 | 260 |
| 264 scoped_ptr<ThemeSyncableService> theme_syncable_service_; | 261 scoped_ptr<ThemeSyncableService> theme_syncable_service_; |
| 265 | 262 |
| 266 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; | 263 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; |
| 267 | 264 |
| 268 DISALLOW_COPY_AND_ASSIGN(ThemeService); | 265 DISALLOW_COPY_AND_ASSIGN(ThemeService); |
| 269 }; | 266 }; |
| 270 | 267 |
| 271 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 268 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| OLD | NEW |