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/settings_overrides_handler.
h" | 5 #include "chrome/common/extensions/manifest_handlers/settings_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/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const Extension* extension) { | 218 const Extension* extension) { |
219 return static_cast<SettingsOverrides*>( | 219 return static_cast<SettingsOverrides*>( |
220 extension->GetManifestData(manifest_keys::kSettingsOverride)); | 220 extension->GetManifestData(manifest_keys::kSettingsOverride)); |
221 } | 221 } |
222 | 222 |
223 bool SettingsOverrides::RemovesBookmarkButton() const { | 223 bool SettingsOverrides::RemovesBookmarkButton() const { |
224 return bookmarks_ui && bookmarks_ui->remove_button && | 224 return bookmarks_ui && bookmarks_ui->remove_button && |
225 *bookmarks_ui->remove_button; | 225 *bookmarks_ui->remove_button; |
226 } | 226 } |
227 | 227 |
| 228 bool SettingsOverrides::RemovesBookmarkShortcut() const { |
| 229 return bookmarks_ui && bookmarks_ui->remove_bookmark_shortcut && |
| 230 *bookmarks_ui->remove_bookmark_shortcut; |
| 231 } |
| 232 |
228 SettingsOverridesHandler::SettingsOverridesHandler() {} | 233 SettingsOverridesHandler::SettingsOverridesHandler() {} |
229 | 234 |
230 SettingsOverridesHandler::~SettingsOverridesHandler() {} | 235 SettingsOverridesHandler::~SettingsOverridesHandler() {} |
231 | 236 |
232 bool SettingsOverridesHandler::Parse(Extension* extension, | 237 bool SettingsOverridesHandler::Parse(Extension* extension, |
233 base::string16* error) { | 238 base::string16* error) { |
234 const base::Value* dict = NULL; | 239 const base::Value* dict = NULL; |
235 CHECK(extension->manifest()->Get(manifest_keys::kSettingsOverride, &dict)); | 240 CHECK(extension->manifest()->Get(manifest_keys::kSettingsOverride, &dict)); |
236 scoped_ptr<ChromeSettingsOverrides> settings( | 241 scoped_ptr<ChromeSettingsOverrides> settings( |
237 ChromeSettingsOverrides::FromValue(*dict, error)); | 242 ChromeSettingsOverrides::FromValue(*dict, error)); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 const SettingsOverrides* data = SettingsOverrides::Get(extension); | 324 const SettingsOverrides* data = SettingsOverrides::Get(extension); |
320 if (data) | 325 if (data) |
321 return data->manifest_permission->Clone(); | 326 return data->manifest_permission->Clone(); |
322 return NULL; | 327 return NULL; |
323 } | 328 } |
324 const std::vector<std::string> SettingsOverridesHandler::Keys() const { | 329 const std::vector<std::string> SettingsOverridesHandler::Keys() const { |
325 return SingleKey(manifest_keys::kSettingsOverride); | 330 return SingleKey(manifest_keys::kSettingsOverride); |
326 } | 331 } |
327 | 332 |
328 } // namespace extensions | 333 } // namespace extensions |
OLD | NEW |