| Index: chrome/browser/extensions/test_extension_management_policy.h
|
| ===================================================================
|
| --- chrome/browser/extensions/test_extension_management_policy.h (revision 0)
|
| +++ chrome/browser/extensions/test_extension_management_policy.h (revision 0)
|
| @@ -0,0 +1,56 @@
|
| +// 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.
|
| +
|
| +#ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_
|
| +#define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_
|
| +#pragma once
|
| +
|
| +#include "base/string16.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +
|
| +// *** comment here
|
| +class TestExtensionManagementPolicyDelegate
|
| + : public ExtensionManagementPolicy::Delegate {
|
| + public:
|
| + enum AllowedActionFlag {
|
| + ALLOW_ALL = 0,
|
| + PROHIBIT_INSTALL = 1 << 0,
|
| + PROHIBIT_MODIFY_STATUS = 1 << 1,
|
| + PROHIBIT_MODIFY_USAGE = 1 << 2,
|
| + MUST_REMAIN_ENABLED = 1 << 3
|
| + };
|
| +
|
| + static std::string expected_error() {
|
| + return "Action prohibited by test delegate.";
|
| + }
|
| +
|
| + TestExtensionManagementPolicyDelegate();
|
| + explicit TestExtensionManagementPolicyDelegate(int allowed_actions);
|
| +
|
| + void SetAllowedActions(int allowed_actions);
|
| +
|
| + virtual bool UserMayInstall(const std::string& extension_id,
|
| + Extension::Location location,
|
| + const std::string& extension_name,
|
| + string16* error) const OVERRIDE;
|
| +
|
| + virtual bool UserMayModifyStatus(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| +
|
| + virtual bool UserMayModifyUsage(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| +
|
| + virtual bool MustRemainEnabled(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| +
|
| + private:
|
| + bool may_install_;
|
| + bool may_modify_status_;
|
| + bool may_modify_usage_;
|
| + bool must_remain_enabled_;
|
| +
|
| + string16 error_message_;
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_
|
|
|
| Property changes on: chrome\browser\extensions\test_extension_management_policy.h
|
| ___________________________________________________________________
|
| Added: svn:executable
|
| + *
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|