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 "chrome/common/extensions/manifest_handlers/ui_overrides_handler.h" | 5 #include "chrome/common/extensions/manifest_handlers/ui_overrides_handler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 return permissions; | 45 return permissions; |
46 } | 46 } |
47 | 47 |
48 bool FromValue(const base::Value* value) override { | 48 bool FromValue(const base::Value* value) override { |
49 return value && value->GetAsBoolean(&override_bookmarks_ui_permission_); | 49 return value && value->GetAsBoolean(&override_bookmarks_ui_permission_); |
50 } | 50 } |
51 | 51 |
52 std::unique_ptr<base::Value> ToValue() const override { | 52 std::unique_ptr<base::Value> ToValue() const override { |
53 return std::unique_ptr<base::Value>( | 53 return std::unique_ptr<base::Value>( |
54 new base::FundamentalValue(override_bookmarks_ui_permission_)); | 54 new base::Value(override_bookmarks_ui_permission_)); |
55 } | 55 } |
56 | 56 |
57 ManifestPermission* Diff(const ManifestPermission* rhs) const override { | 57 ManifestPermission* Diff(const ManifestPermission* rhs) const override { |
58 const ManifestPermissionImpl* other = | 58 const ManifestPermissionImpl* other = |
59 static_cast<const ManifestPermissionImpl*>(rhs); | 59 static_cast<const ManifestPermissionImpl*>(rhs); |
60 | 60 |
61 return std::unique_ptr<ManifestPermissionImpl>( | 61 return std::unique_ptr<ManifestPermissionImpl>( |
62 new ManifestPermissionImpl( | 62 new ManifestPermissionImpl( |
63 override_bookmarks_ui_permission_ && | 63 override_bookmarks_ui_permission_ && |
64 !other->override_bookmarks_ui_permission_)) | 64 !other->override_bookmarks_ui_permission_)) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 const UIOverrides* data = UIOverrides::Get(extension); | 174 const UIOverrides* data = UIOverrides::Get(extension); |
175 if (data) | 175 if (data) |
176 return data->manifest_permission->Clone(); | 176 return data->manifest_permission->Clone(); |
177 return NULL; | 177 return NULL; |
178 } | 178 } |
179 const std::vector<std::string> UIOverridesHandler::Keys() const { | 179 const std::vector<std::string> UIOverridesHandler::Keys() const { |
180 return SingleKey(manifest_keys::kUIOverride); | 180 return SingleKey(manifest_keys::kUIOverride); |
181 } | 181 } |
182 | 182 |
183 } // namespace extensions | 183 } // namespace extensions |
OLD | NEW |