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

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: Addressing Bernhard's comments 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,37 @@
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();
+
+ 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. Sets error_ if the extension doesn't have the needed
Bernhard Bauer 2012/03/02 09:23:59 Tiny nit: |error_|
+ // permission.
+ 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;
« no previous file with comments | « chrome/browser/extensions/extension_managed_mode_apitest.cc ('k') | chrome/browser/extensions/extension_preference_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698