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

Unified Diff: chrome/common/extensions/command.cc

Issue 23812010: Implement first part of supporting global extension commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gclient sync Created 7 years, 2 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
« no previous file with comments | « chrome/common/extensions/command.h ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/command.cc
diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc
index 038705b270a95dd41440ff096414fb194c96d5ff..6e87d7a4853c546981c80a2f68b5704b0494431d 100644
--- a/chrome/common/extensions/command.cc
+++ b/chrome/common/extensions/command.cc
@@ -250,13 +250,15 @@ std::string NormalizeShortcutSuggestion(const std::string& suggestion,
} // namespace
-Command::Command() {}
+Command::Command() : global_(false) {}
Command::Command(const std::string& command_name,
const string16& description,
- const std::string& accelerator)
+ const std::string& accelerator,
+ bool global)
: command_name_(command_name),
- description_(description) {
+ description_(description),
+ global_(global) {
string16 error;
accelerator_ = ParseImpl(accelerator, CommandPlatform(), 0,
IsNamedCommand(command_name), &error);
@@ -432,6 +434,10 @@ bool Command::Parse(const base::DictionaryValue* command,
}
}
+ // Check if this is a global or a regular shortcut.
+ bool global = false;
+ command->GetBoolean(keys::kGlobal, &global);
+
// Normalize the suggestions.
for (SuggestionMap::iterator iter = suggestions.begin();
iter != suggestions.end(); ++iter) {
@@ -494,6 +500,7 @@ bool Command::Parse(const base::DictionaryValue* command,
accelerator_ = accelerator;
command_name_ = command_name;
description_ = description;
+ global_ = global;
}
}
return true;
« no previous file with comments | « chrome/common/extensions/command.h ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698