| Index: chrome/browser/extensions/test_extension_management_policy.cc
|
| ===================================================================
|
| --- chrome/browser/extensions/test_extension_management_policy.cc (revision 0)
|
| +++ chrome/browser/extensions/test_extension_management_policy.cc (revision 0)
|
| @@ -0,0 +1,61 @@
|
| +// 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.
|
| +
|
| +#include "chrome/browser/extensions/test_extension_management_policy.h"
|
| +
|
| +#include "base/utf_string_conversions.h"
|
| +
|
| +// *** comment here
|
| +TestExtensionManagementPolicyDelegate::
|
| + TestExtensionManagementPolicyDelegate() : may_install_(true),
|
| + may_modify_status_(true),
|
| + may_modify_usage_(true),
|
| + must_remain_enabled_(false) {
|
| + error_message_ = UTF8ToUTF16(expected_error());
|
| +}
|
| +
|
| +TestExtensionManagementPolicyDelegate::
|
| + TestExtensionManagementPolicyDelegate(int allowed_actions) {
|
| + SetAllowedActions(allowed_actions);
|
| + error_message_ = UTF8ToUTF16(expected_error());
|
| +}
|
| +
|
| +void TestExtensionManagementPolicyDelegate::SetAllowedActions(
|
| + int allowed_actions) {
|
| + may_install_ = (allowed_actions & PROHIBIT_INSTALL) == 0;
|
| + may_modify_status_ = (allowed_actions & PROHIBIT_MODIFY_STATUS) == 0;
|
| + may_modify_usage_ = (allowed_actions & PROHIBIT_MODIFY_USAGE) == 0;
|
| + must_remain_enabled_ = (allowed_actions & MUST_REMAIN_ENABLED) != 0;
|
| +}
|
| +
|
| +bool TestExtensionManagementPolicyDelegate::UserMayInstall(
|
| + const std::string& extension_id,
|
| + Extension::Location location,
|
| + const std::string& extension_name,
|
| + string16* error) const {
|
| + if (error && !may_install_)
|
| + *error = error_message_;
|
| + return may_install_;
|
| +}
|
| +
|
| +bool TestExtensionManagementPolicyDelegate::UserMayModifyStatus(
|
| + const Extension* extension, string16* error) const {
|
| + if (error && !may_modify_status_)
|
| + *error = error_message_;
|
| + return may_modify_status_;
|
| +}
|
| +
|
| +bool TestExtensionManagementPolicyDelegate::UserMayModifyUsage(
|
| + const Extension* extension, string16* error) const {
|
| + if (error && !may_modify_usage_)
|
| + *error = error_message_;
|
| + return may_modify_usage_;
|
| +}
|
| +
|
| +bool TestExtensionManagementPolicyDelegate::MustRemainEnabled(
|
| + const Extension* extension, string16* error) const {
|
| + if (error && must_remain_enabled_)
|
| + *error = error_message_;
|
| + return must_remain_enabled_;
|
| +}
|
|
|
| Property changes on: chrome\browser\extensions\test_extension_management_policy.cc
|
| ___________________________________________________________________
|
| Added: svn:executable
|
| + *
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|