Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / permissions / settings_override_permission.h
blob8f8a4e3a7758df55bb48423e45ab05e71543c93c
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_
6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_
8 #include <string>
10 #include "extensions/common/permissions/api_permission.h"
12 namespace extensions {
14 // Takes care of creating custom permission messages for extensions that
15 // override settings.
16 class SettingsOverrideAPIPermission : public APIPermission {
17 public:
18 SettingsOverrideAPIPermission(
19 const APIPermissionInfo* permission, const std::string& setting_value);
20 virtual ~SettingsOverrideAPIPermission();
22 // APIPermission overrides.
23 virtual bool HasMessages() const OVERRIDE;
24 virtual PermissionMessages GetMessages() const OVERRIDE;
25 virtual bool Check(const APIPermission::CheckParam* param) const OVERRIDE;
26 virtual bool Contains(const APIPermission* rhs) const OVERRIDE;
27 virtual bool Equal(const APIPermission* rhs) const OVERRIDE;
28 virtual bool FromValue(const base::Value* value) OVERRIDE;
29 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE;
30 virtual APIPermission* Clone() const OVERRIDE;
31 virtual APIPermission* Diff(const APIPermission* rhs) const OVERRIDE;
32 virtual APIPermission* Union(const APIPermission* rhs) const OVERRIDE;
33 virtual APIPermission* Intersect(const APIPermission* rhs) const OVERRIDE;
34 virtual void Write(IPC::Message* m) const OVERRIDE;
35 virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE;
36 virtual void Log(std::string* log) const OVERRIDE;
38 private:
39 std::string setting_value_;
42 } // namespace extensions
44 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_SETTINGS_OVERRIDE_PERMISSION_H_