OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/test_management_policy.h" | 5 #include "extensions/browser/test_management_policy.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
11 TestManagementPolicyProvider::TestManagementPolicyProvider() | 11 TestManagementPolicyProvider::TestManagementPolicyProvider() |
12 : may_load_(true), | 12 : may_load_(true), |
13 may_modify_status_(true), | 13 may_modify_status_(true), |
14 must_remain_enabled_(false), | 14 must_remain_enabled_(false), |
15 must_remain_disabled_(false), | 15 must_remain_disabled_(false), |
16 disable_reason_(Extension::DISABLE_NONE) { | 16 disable_reason_(Extension::DISABLE_NONE) { |
17 error_message_ = UTF8ToUTF16(expected_error()); | 17 error_message_ = base::UTF8ToUTF16(expected_error()); |
18 } | 18 } |
19 | 19 |
20 TestManagementPolicyProvider::TestManagementPolicyProvider( | 20 TestManagementPolicyProvider::TestManagementPolicyProvider( |
21 int prohibited_actions) { | 21 int prohibited_actions) { |
22 SetProhibitedActions(prohibited_actions); | 22 SetProhibitedActions(prohibited_actions); |
23 error_message_ = UTF8ToUTF16(expected_error()); | 23 error_message_ = base::UTF8ToUTF16(expected_error()); |
24 } | 24 } |
25 | 25 |
26 void TestManagementPolicyProvider::SetProhibitedActions( | 26 void TestManagementPolicyProvider::SetProhibitedActions( |
27 int prohibited_actions) { | 27 int prohibited_actions) { |
28 may_load_ = (prohibited_actions & PROHIBIT_LOAD) == 0; | 28 may_load_ = (prohibited_actions & PROHIBIT_LOAD) == 0; |
29 may_modify_status_ = (prohibited_actions & PROHIBIT_MODIFY_STATUS) == 0; | 29 may_modify_status_ = (prohibited_actions & PROHIBIT_MODIFY_STATUS) == 0; |
30 must_remain_enabled_ = (prohibited_actions & MUST_REMAIN_ENABLED) != 0; | 30 must_remain_enabled_ = (prohibited_actions & MUST_REMAIN_ENABLED) != 0; |
31 must_remain_disabled_ = (prohibited_actions & MUST_REMAIN_DISABLED) != 0; | 31 must_remain_disabled_ = (prohibited_actions & MUST_REMAIN_DISABLED) != 0; |
32 } | 32 } |
33 | 33 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (error) | 70 if (error) |
71 *error = error_message_; | 71 *error = error_message_; |
72 if (reason) | 72 if (reason) |
73 *reason = disable_reason_; | 73 *reason = disable_reason_; |
74 } | 74 } |
75 return must_remain_disabled_; | 75 return must_remain_disabled_; |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 } // namespace extensions | 79 } // namespace extensions |
OLD | NEW |