| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_WEBUI_THEME_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_THEME_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_THEME_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_THEME_HANDLER_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/notification_observer.h" | 8 #include "content/public/browser/notification_observer.h" |
| 9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class WebUI; | 15 class WebUI; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // A class to keep the ThemeSource up to date when theme changes. | 18 // A class to keep the ThemeSource up to date when theme changes. |
| 19 class ThemeHandler : public content::WebUIMessageHandler, | 19 class ThemeHandler : public content::WebUIMessageHandler, |
| 20 public content::NotificationObserver { | 20 public content::NotificationObserver { |
| 21 public: | 21 public: |
| 22 explicit ThemeHandler(); | 22 explicit ThemeHandler(); |
| 23 virtual ~ThemeHandler(); | 23 virtual ~ThemeHandler(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 // content::WebUIMessageHandler implementation. | 26 // content::WebUIMessageHandler implementation. |
| 27 virtual void RegisterMessages() OVERRIDE; | 27 virtual void RegisterMessages() override; |
| 28 | 28 |
| 29 // Re/set the CSS caches. | 29 // Re/set the CSS caches. |
| 30 void InitializeCSSCaches(); | 30 void InitializeCSSCaches(); |
| 31 | 31 |
| 32 // content::NotificationObserver implementation. | 32 // content::NotificationObserver implementation. |
| 33 virtual void Observe(int type, | 33 virtual void Observe(int type, |
| 34 const content::NotificationSource& source, | 34 const content::NotificationSource& source, |
| 35 const content::NotificationDetails& details) OVERRIDE; | 35 const content::NotificationDetails& details) override; |
| 36 | 36 |
| 37 Profile* GetProfile() const; | 37 Profile* GetProfile() const; |
| 38 | 38 |
| 39 content::NotificationRegistrar registrar_; | 39 content::NotificationRegistrar registrar_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(ThemeHandler); | 41 DISALLOW_COPY_AND_ASSIGN(ThemeHandler); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 #endif // CHROME_BROWSER_UI_WEBUI_THEME_HANDLER_H_ | 44 #endif // CHROME_BROWSER_UI_WEBUI_THEME_HANDLER_H_ |
| OLD | NEW |