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

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

Issue 10201016: Conflict detection for Extension Keybinding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressed comments Created 8 years, 8 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/extension.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 134889)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -331,6 +331,21 @@
return ui::Accelerator(key, shift, ctrl, alt);
}
+// static
+std::string Extension::ExtensionKeybinding::KeybindingPlatform() {
+#if defined(OS_WIN)
+ return values::kKeybindingPlatformWin;
+#elif defined(OS_MACOSX)
+ return values::kKeybindingPlatformMac;
+#elif defined(OS_CHROMEOS)
+ return values::kKeybindingPlatformChromeOs;
+#elif defined(OS_LINUX)
+ return values::kKeybindingPlatformLinux;
+#else
+ return "";
+#endif
+}
+
bool Extension::ExtensionKeybinding::Parse(DictionaryValue* command,
const std::string& command_name,
int index,
@@ -379,19 +394,7 @@
}
}
- std::string platform =
-#if defined(OS_WIN)
- values::kKeybindingPlatformWin;
-#elif defined(OS_MACOSX)
- values::kKeybindingPlatformMac;
-#elif defined(OS_CHROMEOS)
- values::kKeybindingPlatformChromeOs;
-#elif defined(OS_LINUX)
- values::kKeybindingPlatformLinux;
-#else
- "";
-#endif
-
+ std::string platform = KeybindingPlatform();
std::string key = platform;
if (suggestions.find(key) == suggestions.end())
key = values::kKeybindingPlatformDefault;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698