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_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
| 10 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 11 |
| 12 class ExtensionFontSettingsEventRouter : public content::NotificationObserver { |
| 13 public: |
| 14 explicit ExtensionFontSettingsEventRouter(Profile* profile); |
| 15 virtual ~ExtensionFontSettingsEventRouter(); |
| 16 |
| 17 void Init(); |
| 18 |
| 19 private: |
| 20 // content::NotificationObserver implementation. |
| 21 virtual void Observe(int type, |
| 22 const content::NotificationSource& source, |
| 23 const content::NotificationDetails& details) OVERRIDE; |
| 24 |
| 25 PrefChangeRegistrar registrar_; |
| 26 |
| 27 // Weak, owns us (transitively via ExtensionService). |
| 28 Profile* profile_; |
| 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(ExtensionFontSettingsEventRouter); |
| 31 }; |
10 | 32 |
11 class GetFontNameFunction : public SyncExtensionFunction { | 33 class GetFontNameFunction : public SyncExtensionFunction { |
12 public: | 34 public: |
13 virtual bool RunImpl() OVERRIDE; | 35 virtual bool RunImpl() OVERRIDE; |
14 DECLARE_EXTENSION_FUNCTION_NAME("experimental.fontSettings.getFontName") | 36 DECLARE_EXTENSION_FUNCTION_NAME("experimental.fontSettings.getFontName") |
15 }; | 37 }; |
16 | 38 |
17 class SetFontNameFunction : public SyncExtensionFunction { | 39 class SetFontNameFunction : public SyncExtensionFunction { |
18 public: | 40 public: |
19 virtual bool RunImpl() OVERRIDE; | 41 virtual bool RunImpl() OVERRIDE; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 class SetMinimumFontSizeFunction : public SetFontSizeExtensionFunction { | 118 class SetMinimumFontSizeFunction : public SetFontSizeExtensionFunction { |
97 public: | 119 public: |
98 DECLARE_EXTENSION_FUNCTION_NAME( | 120 DECLARE_EXTENSION_FUNCTION_NAME( |
99 "experimental.fontSettings.setMinimumFontSize") | 121 "experimental.fontSettings.setMinimumFontSize") |
100 | 122 |
101 protected: | 123 protected: |
102 virtual const char* GetPrefName() OVERRIDE; | 124 virtual const char* GetPrefName() OVERRIDE; |
103 }; | 125 }; |
104 | 126 |
105 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ | 127 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__ |
OLD | NEW |