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

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

Issue 9566007: Initial Managed Mode extension API, supporting querying the setting and a stub for enabling the mod… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Now with 12.5% more added files (including missing apitest) Created 8 years, 10 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
Index: chrome/browser/extensions/extension_preference_api.h
===================================================================
--- chrome/browser/extensions/extension_preference_api.h (revision 124408)
+++ chrome/browser/extensions/extension_preference_api.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -66,21 +66,35 @@
const base::Value* browser_pref) = 0;
};
-class GetPreferenceFunction : public SyncExtensionFunction {
+// A base class to provide functionality common to the other *PreferenceFunction
+// classes.
+class PreferenceFunction : public SyncExtensionFunction {
public:
+ virtual ~PreferenceFunction();
Bernhard Bauer 2012/03/01 16:32:14 Nit: new line?
+ protected:
+ // Given an |extension_pref_key|, provides its |browser_pref_key| from the
+ // static map in extension_preference.cc. Returns true if the corresponding
+ // browser pref exists and the extension has the API permission needed to
+ // modify that pref.
Bernhard Bauer 2012/03/01 16:32:14 Can you add a comment that it sets an error if the
+ bool ValidateBrowserPref(std::string extension_pref_key,
+ std::string* browser_pref_key);
+};
+
+class GetPreferenceFunction : public PreferenceFunction {
+ public:
virtual ~GetPreferenceFunction();
virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME("types.ChromeSetting.get")
};
-class SetPreferenceFunction : public SyncExtensionFunction {
+class SetPreferenceFunction : public PreferenceFunction {
public:
virtual ~SetPreferenceFunction();
virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME("types.ChromeSetting.set")
};
-class ClearPreferenceFunction : public SyncExtensionFunction {
+class ClearPreferenceFunction : public PreferenceFunction {
public:
virtual ~ClearPreferenceFunction();
virtual bool RunImpl() OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698