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

Unified Diff: chrome/common/extensions/permissions/settings_override_permission.h

Issue 55533003: Add extension permissions for new settings override API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trimmed schema/www. and only show one start page. Created 7 years, 1 month 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/common/extensions/permissions/settings_override_permission.h
diff --git a/chrome/common/extensions/permissions/settings_override_permission.h b/chrome/common/extensions/permissions/settings_override_permission.h
new file mode 100644
index 0000000000000000000000000000000000000000..65db2cb01d245b1a931ce765e3f2684a68276b47
--- /dev/null
+++ b/chrome/common/extensions/permissions/settings_override_permission.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_
+#define CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_
+
+#include <string>
+
+#include "extensions/common/permissions/api_permission.h"
+
+namespace extensions {
+
+// This class takes care of creating custom permission messages for extensions
gab 2013/11/01 22:35:40 s/This class takes care.../Takes care...
MAD 2013/11/03 02:21:20 Done.
+// that overrides settings.
gab 2013/11/01 22:35:40 s/overrides/override (since extensions is plural)
MAD 2013/11/03 02:21:20 Done.
+class SettingsOverrideAPIPermission : public APIPermission {
+ public:
+ explicit SettingsOverrideAPIPermission(
gab 2013/11/01 22:35:40 -explicit
MAD 2013/11/03 02:21:20 Not needed when there is more than one argument.
gab 2013/11/04 18:04:30 Right, that's why I was saying to remove it...
+ const APIPermissionInfo* permission, const std::string setting_value);
gab 2013/11/01 22:35:40 s/const std::string/const std::string&
MAD 2013/11/03 02:21:20 Done.
+ virtual ~SettingsOverrideAPIPermission();
+
+ // APIPermission overrides.
+ virtual bool HasMessages() const OVERRIDE;
+ virtual PermissionMessages GetMessages() const OVERRIDE;
+ virtual bool Check(const APIPermission::CheckParam* param) const OVERRIDE;
+ virtual bool Contains(const APIPermission* rhs) const OVERRIDE;
+ virtual bool Equal(const APIPermission* rhs) const OVERRIDE;
+ virtual bool FromValue(const base::Value* value) OVERRIDE;
+ virtual scoped_ptr<base::Value> ToValue() const OVERRIDE;
+ virtual APIPermission* Clone() const OVERRIDE;
+ virtual APIPermission* Diff(const APIPermission* rhs) const OVERRIDE;
+ virtual APIPermission* Union(const APIPermission* rhs) const OVERRIDE;
+ virtual APIPermission* Intersect(const APIPermission* rhs) const OVERRIDE;
+ virtual void Write(IPC::Message* m) const OVERRIDE;
+ virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE;
+ virtual void Log(std::string* log) const OVERRIDE;
+
+ private:
+ std::string setting_value_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_

Powered by Google App Engine
This is Rietveld 408576698