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 |
(...skipping 23 matching lines...) Expand all Loading... |
34 void TestManagementPolicyProvider::SetDisableReason( | 34 void TestManagementPolicyProvider::SetDisableReason( |
35 Extension::DisableReason reason) { | 35 Extension::DisableReason reason) { |
36 disable_reason_ = reason; | 36 disable_reason_ = reason; |
37 } | 37 } |
38 | 38 |
39 std::string TestManagementPolicyProvider::GetDebugPolicyProviderName() const { | 39 std::string TestManagementPolicyProvider::GetDebugPolicyProviderName() const { |
40 return "the test management policy provider"; | 40 return "the test management policy provider"; |
41 } | 41 } |
42 | 42 |
43 bool TestManagementPolicyProvider::UserMayLoad(const Extension* extension, | 43 bool TestManagementPolicyProvider::UserMayLoad(const Extension* extension, |
44 string16* error) const { | 44 base::string16* error) const { |
45 if (error && !may_load_) | 45 if (error && !may_load_) |
46 *error = error_message_; | 46 *error = error_message_; |
47 return may_load_; | 47 return may_load_; |
48 } | 48 } |
49 | 49 |
50 bool TestManagementPolicyProvider::UserMayModifySettings( | 50 bool TestManagementPolicyProvider::UserMayModifySettings( |
51 const Extension* extension, string16* error) const { | 51 const Extension* extension, base::string16* error) const { |
52 if (error && !may_modify_status_) | 52 if (error && !may_modify_status_) |
53 *error = error_message_; | 53 *error = error_message_; |
54 return may_modify_status_; | 54 return may_modify_status_; |
55 } | 55 } |
56 | 56 |
57 bool TestManagementPolicyProvider::MustRemainEnabled(const Extension* extension, | 57 bool TestManagementPolicyProvider::MustRemainEnabled(const Extension* extension, |
58 string16* error) const { | 58 base::string16* error) |
| 59 const { |
59 if (error && must_remain_enabled_) | 60 if (error && must_remain_enabled_) |
60 *error = error_message_; | 61 *error = error_message_; |
61 return must_remain_enabled_; | 62 return must_remain_enabled_; |
62 } | 63 } |
63 | 64 |
64 bool TestManagementPolicyProvider::MustRemainDisabled( | 65 bool TestManagementPolicyProvider::MustRemainDisabled( |
65 const Extension* extension, | 66 const Extension* extension, |
66 Extension::DisableReason* reason, | 67 Extension::DisableReason* reason, |
67 string16* error) const { | 68 base::string16* error) const { |
68 if (must_remain_disabled_) { | 69 if (must_remain_disabled_) { |
69 if (error) | 70 if (error) |
70 *error = error_message_; | 71 *error = error_message_; |
71 if (reason) | 72 if (reason) |
72 *reason = disable_reason_; | 73 *reason = disable_reason_; |
73 } | 74 } |
74 return must_remain_disabled_; | 75 return must_remain_disabled_; |
75 } | 76 } |
76 | 77 |
77 | 78 |
78 } // namespace extensions | 79 } // namespace extensions |
OLD | NEW |