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

Unified Diff: chrome/browser/extensions/api/commands/command_service_new.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/commands/command_service_new.cc
diff --git a/chrome/browser/extensions/api/commands/command_service_new.cc b/chrome/browser/extensions/api/commands/command_service_new.cc
index 98cbe6dcfafed4896a1e47e4b55b4d54da3417d1..4143d6a29f55ca171e6673e0be67da933dacadac 100644
--- a/chrome/browser/extensions/api/commands/command_service_new.cc
+++ b/chrome/browser/extensions/api/commands/command_service_new.cc
@@ -141,14 +141,14 @@ bool CommandService::AddKeybindingPref(
DictionaryPrefUpdate updater(profile_->GetPrefs(),
prefs::kExtensionCommands);
- DictionaryValue* bindings = updater.Get();
+ base::DictionaryValue* bindings = updater.Get();
std::string key = GetPlatformKeybindingKeyForAccelerator(accelerator);
if (!allow_overrides && bindings->HasKey(key))
return false; // Already taken.
- DictionaryValue* keybinding = new DictionaryValue();
+ base::DictionaryValue* keybinding = new base::DictionaryValue();
keybinding->SetString(kExtension, extension_id);
keybinding->SetString(kCommandName, command_name);
@@ -198,10 +198,11 @@ void CommandService::UpdateKeybindingPrefs(const std::string& extension_id,
ui::Accelerator CommandService::FindShortcutForCommand(
const std::string& extension_id, const std::string& command) {
- const DictionaryValue* bindings =
+ const base::DictionaryValue* bindings =
profile_->GetPrefs()->GetDictionary(prefs::kExtensionCommands);
- for (DictionaryValue::Iterator it(*bindings); !it.IsAtEnd(); it.Advance()) {
- const DictionaryValue* item = NULL;
+ for (base::DictionaryValue::Iterator it(*bindings); !it.IsAtEnd();
+ it.Advance()) {
+ const base::DictionaryValue* item = NULL;
it.value().GetAsDictionary(&item);
std::string extension;
@@ -269,12 +270,13 @@ void CommandService::RemoveKeybindingPrefs(const std::string& extension_id,
const std::string& command_name) {
DictionaryPrefUpdate updater(profile_->GetPrefs(),
prefs::kExtensionCommands);
- DictionaryValue* bindings = updater.Get();
+ base::DictionaryValue* bindings = updater.Get();
typedef std::vector<std::string> KeysToRemove;
KeysToRemove keys_to_remove;
- for (DictionaryValue::Iterator it(*bindings); !it.IsAtEnd(); it.Advance()) {
- const DictionaryValue* item = NULL;
+ for (base::DictionaryValue::Iterator it(*bindings); !it.IsAtEnd();
+ it.Advance()) {
+ const base::DictionaryValue* item = NULL;
it.value().GetAsDictionary(&item);
std::string extension;

Powered by Google App Engine
This is Rietveld 408576698