| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.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 scoped_ptr<base::Value> ToValue() const override { | 52 scoped_ptr<base::Value> ToValue() const override { |
| 53 return scoped_ptr<base::Value>( | 53 return scoped_ptr<base::Value>( |
| 54 new base::FundamentalValue(override_bookmarks_ui_permission_)).Pass(); | 54 new base::FundamentalValue(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 scoped_ptr<ManifestPermissionImpl>(new ManifestPermissionImpl( | 61 return scoped_ptr<ManifestPermissionImpl>(new ManifestPermissionImpl( |
| 62 override_bookmarks_ui_permission_ && | 62 override_bookmarks_ui_permission_ && |
| 63 !other->override_bookmarks_ui_permission_)).release(); | 63 !other->override_bookmarks_ui_permission_)).release(); |
| 64 } | 64 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 const UIOverrides* data = UIOverrides::Get(extension); | 168 const UIOverrides* data = UIOverrides::Get(extension); |
| 169 if (data) | 169 if (data) |
| 170 return data->manifest_permission->Clone(); | 170 return data->manifest_permission->Clone(); |
| 171 return NULL; | 171 return NULL; |
| 172 } | 172 } |
| 173 const std::vector<std::string> UIOverridesHandler::Keys() const { | 173 const std::vector<std::string> UIOverridesHandler::Keys() const { |
| 174 return SingleKey(manifest_keys::kUIOverride); | 174 return SingleKey(manifest_keys::kUIOverride); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace extensions | 177 } // namespace extensions |
| OLD | NEW |