Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: chrome/browser/extensions/extension_font_settings_api.h

Issue 9853013: Expose more font size prefs to the Font Settings Extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "true" to true Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_font_settings_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_font_settings_api.h
diff --git a/chrome/browser/extensions/extension_font_settings_api.h b/chrome/browser/extensions/extension_font_settings_api.h
index 49776f2d0c558e4e74c9499431fc9d4b94a448e4..27aeb8614cbf6c5acc612f4a437d021e0a30138a 100644
--- a/chrome/browser/extensions/extension_font_settings_api.h
+++ b/chrome/browser/extensions/extension_font_settings_api.h
@@ -30,18 +30,76 @@ class GetFontListFunction : public AsyncExtensionFunction {
bool CopyFontsToResult(base::ListValue* fonts);
};
-class GetDefaultFontSizeFunction : public SyncExtensionFunction {
- public:
+// Base class for functions that get a font size.
+class GetFontSizeExtensionFunction : public SyncExtensionFunction {
+ protected:
+ virtual bool RunImpl() OVERRIDE;
+
+ // Implementations should return the name of the font size preference to get.
+ virtual const char* GetPrefName() = 0;
+};
+
+// Base class for functions that set a font size.
+class SetFontSizeExtensionFunction : public SyncExtensionFunction {
+ protected:
virtual bool RunImpl() OVERRIDE;
+
+ // Implementations should return the name of the font size preference to set.
+ virtual const char* GetPrefName() = 0;
+};
+
+class GetDefaultFontSizeFunction : public GetFontSizeExtensionFunction {
+ public:
DECLARE_EXTENSION_FUNCTION_NAME(
"experimental.fontSettings.getDefaultFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
};
-class SetDefaultFontSizeFunction : public SyncExtensionFunction {
+class SetDefaultFontSizeFunction : public SetFontSizeExtensionFunction {
public:
- virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME(
"experimental.fontSettings.setDefaultFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
+class GetDefaultFixedFontSizeFunction : public GetFontSizeExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.getDefaultFixedFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
+class SetDefaultFixedFontSizeFunction : public SetFontSizeExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.setDefaultFixedFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
+class GetMinimumFontSizeFunction : public GetFontSizeExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.getMinimumFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
+class SetMinimumFontSizeFunction : public SetFontSizeExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.setMinimumFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FONT_SETTINGS_API_H__
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_font_settings_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698