| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/string16.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 |
| 12 // *** comment here |
| 13 class TestExtensionManagementPolicyDelegate |
| 14 : public ExtensionManagementPolicy::Delegate { |
| 15 public: |
| 16 enum AllowedActionFlag { |
| 17 ALLOW_ALL = 0, |
| 18 PROHIBIT_INSTALL = 1 << 0, |
| 19 PROHIBIT_MODIFY_STATUS = 1 << 1, |
| 20 PROHIBIT_MODIFY_USAGE = 1 << 2, |
| 21 MUST_REMAIN_ENABLED = 1 << 3 |
| 22 }; |
| 23 |
| 24 static std::string expected_error() { |
| 25 return "Action prohibited by test delegate."; |
| 26 } |
| 27 |
| 28 TestExtensionManagementPolicyDelegate(); |
| 29 explicit TestExtensionManagementPolicyDelegate(int allowed_actions); |
| 30 |
| 31 void SetAllowedActions(int allowed_actions); |
| 32 |
| 33 virtual bool UserMayInstall(const std::string& extension_id, |
| 34 Extension::Location location, |
| 35 const std::string& extension_name, |
| 36 string16* error) const OVERRIDE; |
| 37 |
| 38 virtual bool UserMayModifyStatus(const Extension* extension, |
| 39 string16* error) const OVERRIDE; |
| 40 |
| 41 virtual bool UserMayModifyUsage(const Extension* extension, |
| 42 string16* error) const OVERRIDE; |
| 43 |
| 44 virtual bool MustRemainEnabled(const Extension* extension, |
| 45 string16* error) const OVERRIDE; |
| 46 |
| 47 private: |
| 48 bool may_install_; |
| 49 bool may_modify_status_; |
| 50 bool may_modify_usage_; |
| 51 bool must_remain_enabled_; |
| 52 |
| 53 string16 error_message_; |
| 54 }; |
| 55 |
| 56 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_MANAGEMENT_POLICY_H_ |
| OLD | NEW |