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

Unified Diff: chrome/browser/extensions/test_extension_management_policy.h

Issue 9694038: OBSOLETE REVIEW. See http://codereview.chromium.org/10382149/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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/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

Powered by Google App Engine
This is Rietveld 408576698