Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Side by Side Diff: chrome/browser/extensions/api/context_menus/context_menus_api.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/extensions/api/context_menus/context_menus_api.h" 5 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 if (params->create_properties.id.get()) { 160 if (params->create_properties.id.get()) {
161 id.string_uid = *params->create_properties.id; 161 id.string_uid = *params->create_properties.id;
162 } else { 162 } else {
163 if (BackgroundInfo::HasLazyBackgroundPage(GetExtension())) { 163 if (BackgroundInfo::HasLazyBackgroundPage(GetExtension())) {
164 error_ = kIdRequiredError; 164 error_ = kIdRequiredError;
165 return false; 165 return false;
166 } 166 }
167 167
168 // The Generated Id is added by context_menus_custom_bindings.js. 168 // The Generated Id is added by context_menus_custom_bindings.js.
169 DictionaryValue* properties = NULL; 169 base::DictionaryValue* properties = NULL;
170 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &properties)); 170 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &properties));
171 EXTENSION_FUNCTION_VALIDATE(properties->GetInteger(kGeneratedIdKey, 171 EXTENSION_FUNCTION_VALIDATE(properties->GetInteger(kGeneratedIdKey,
172 &id.uid)); 172 &id.uid));
173 } 173 }
174 174
175 std::string title; 175 std::string title;
176 if (params->create_properties.title.get()) 176 if (params->create_properties.title.get())
177 title = *params->create_properties.title; 177 title = *params->create_properties.title;
178 178
179 MenuManager* menu_manager = profile()->GetExtensionService()->menu_manager(); 179 MenuManager* menu_manager = profile()->GetExtensionService()->menu_manager();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 bool ContextMenusRemoveAllFunction::RunImpl() { 384 bool ContextMenusRemoveAllFunction::RunImpl() {
385 ExtensionService* service = profile()->GetExtensionService(); 385 ExtensionService* service = profile()->GetExtensionService();
386 MenuManager* manager = service->menu_manager(); 386 MenuManager* manager = service->menu_manager();
387 manager->RemoveAllContextItems(GetExtension()->id()); 387 manager->RemoveAllContextItems(GetExtension()->id());
388 manager->WriteToStorage(GetExtension()); 388 manager->WriteToStorage(GetExtension());
389 return true; 389 return true;
390 } 390 }
391 391
392 } // namespace extensions 392 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698