OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/permissions/settings_override_permission.h" | 5 #include "extensions/common/permissions/settings_override_permission.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // didn't store the parameter for settings override permissions in prefs. | 55 // didn't store the parameter for settings override permissions in prefs. |
56 // See crbug.com/533086 and crbug.com/619759. | 56 // See crbug.com/533086 and crbug.com/619759. |
57 // TODO(treib,devlin): Remove this for M56, when hopefully all users will have | 57 // TODO(treib,devlin): Remove this for M56, when hopefully all users will have |
58 // updated prefs. | 58 // updated prefs. |
59 // This should read: | 59 // This should read: |
60 // return value && value->GetAsString(&setting_value_); | 60 // return value && value->GetAsString(&setting_value_); |
61 return !value || value->GetAsString(&setting_value_); | 61 return !value || value->GetAsString(&setting_value_); |
62 } | 62 } |
63 | 63 |
64 std::unique_ptr<base::Value> SettingsOverrideAPIPermission::ToValue() const { | 64 std::unique_ptr<base::Value> SettingsOverrideAPIPermission::ToValue() const { |
65 return base::MakeUnique<base::StringValue>(setting_value_); | 65 return base::MakeUnique<base::Value>(setting_value_); |
66 } | 66 } |
67 | 67 |
68 APIPermission* SettingsOverrideAPIPermission::Clone() const { | 68 APIPermission* SettingsOverrideAPIPermission::Clone() const { |
69 return new SettingsOverrideAPIPermission(info(), setting_value_); | 69 return new SettingsOverrideAPIPermission(info(), setting_value_); |
70 } | 70 } |
71 | 71 |
72 APIPermission* SettingsOverrideAPIPermission::Diff( | 72 APIPermission* SettingsOverrideAPIPermission::Diff( |
73 const APIPermission* rhs) const { | 73 const APIPermission* rhs) const { |
74 CHECK_EQ(info(), rhs->info()); | 74 CHECK_EQ(info(), rhs->info()); |
75 return NULL; | 75 return NULL; |
(...skipping 18 matching lines...) Expand all Loading... |
94 bool SettingsOverrideAPIPermission::Read(const base::Pickle* m, | 94 bool SettingsOverrideAPIPermission::Read(const base::Pickle* m, |
95 base::PickleIterator* iter) { | 95 base::PickleIterator* iter) { |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 void SettingsOverrideAPIPermission::Log(std::string* log) const { | 99 void SettingsOverrideAPIPermission::Log(std::string* log) const { |
100 *log = setting_value_; | 100 *log = setting_value_; |
101 } | 101 } |
102 | 102 |
103 } // namespace extensions | 103 } // namespace extensions |
OLD | NEW |