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

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

Issue 10177003: Font Settings Extension API: Add functions to clear prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 5003c0b833cf8a03f6fb82d02eba9e907bb939cc..d60d20537981d27f3b50c79cdacfafbd56ba5519 100644
--- a/chrome/browser/extensions/extension_font_settings_api.h
+++ b/chrome/browser/extensions/extension_font_settings_api.h
@@ -56,6 +56,12 @@ class ExtensionFontSettingsEventRouter : public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(ExtensionFontSettingsEventRouter);
};
+class ClearFontFunction : public SyncExtensionFunction {
+ public:
+ virtual bool RunImpl() OVERRIDE;
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.fontSettings.clearFont")
+};
+
class GetFontFunction : public SyncExtensionFunction {
public:
virtual bool RunImpl() OVERRIDE;
@@ -78,6 +84,16 @@ class GetFontListFunction : public AsyncExtensionFunction {
bool CopyFontsToResult(base::ListValue* fonts);
};
+// Base class for functions that clear a font pref.
+class ClearFontPrefExtensionFunction : public SyncExtensionFunction {
+ protected:
+ virtual bool RunImpl() OVERRIDE;
+
+ // Implementations should return the name of the preference to clear, like
+ // "webkit.webprefs.default_font_size".
+ virtual const char* GetPrefName() = 0;
+};
+
// Base class for functions that get a font pref.
class GetFontPrefExtensionFunction : public SyncExtensionFunction {
protected:
@@ -106,6 +122,15 @@ class SetFontPrefExtensionFunction : public SyncExtensionFunction {
virtual const char* GetKey() = 0;
};
+class ClearDefaultFontSizeFunction : public ClearFontPrefExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.clearDefaultFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
class GetDefaultFontSizeFunction : public GetFontPrefExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME(
@@ -126,6 +151,16 @@ class SetDefaultFontSizeFunction : public SetFontPrefExtensionFunction {
virtual const char* GetKey() OVERRIDE;
};
+class ClearDefaultFixedFontSizeFunction
+ : public ClearFontPrefExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.clearDefaultFixedFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
class GetDefaultFixedFontSizeFunction : public GetFontPrefExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME(
@@ -146,6 +181,15 @@ class SetDefaultFixedFontSizeFunction : public SetFontPrefExtensionFunction {
virtual const char* GetKey() OVERRIDE;
};
+class ClearMinimumFontSizeFunction : public ClearFontPrefExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.clearMinimumFontSize")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
class GetMinimumFontSizeFunction : public GetFontPrefExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME(
@@ -166,6 +210,15 @@ class SetMinimumFontSizeFunction : public SetFontPrefExtensionFunction {
virtual const char* GetKey() OVERRIDE;
};
+class ClearDefaultCharacterSetFunction : public ClearFontPrefExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.fontSettings.clearDefaultCharacterSet")
+
+ protected:
+ virtual const char* GetPrefName() OVERRIDE;
+};
+
class GetDefaultCharacterSetFunction : public GetFontPrefExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME(
« 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