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

Unified Diff: chrome/browser/extensions/extension_keybinding_registry.h

Issue 64273008: [Windows] Finish global and non-global media keys support on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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/extension_keybinding_registry.h
diff --git a/chrome/browser/extensions/extension_keybinding_registry.h b/chrome/browser/extensions/extension_keybinding_registry.h
index 723a6bbbc712eaade3479a492d68cd6e37db006a..f60a7336f37f624bf86ed0bc436c5e77bef046a4 100644
--- a/chrome/browser/extensions/extension_keybinding_registry.h
+++ b/chrome/browser/extensions/extension_keybinding_registry.h
@@ -84,6 +84,10 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver {
// commands are currently ignored, since they are handled elsewhere.
bool ShouldIgnoreCommand(const std::string& command) const;
+ // Fire event targets which the specified accelerator is binding with. Returns
+ // true if we can find the appropriate event targets.
+ bool NotifyEventTargetsByAccelerator(const ui::Accelerator& accelerator);
+
// Notifies appropriate parties that a command has been executed.
void CommandExecuted(const std::string& extension_id,
const std::string& command);
@@ -97,6 +101,12 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver {
std::pair<std::string, std::string> > EventTargets;
EventTargets event_targets_;
+ // Maps an accelerator that are media keys to a list of string pair (extension
+ // id, command name) for media keys commands that have been registered.
+ typedef std::list<std::pair<std::string, std::string> > TargetList;
+ typedef std::map<ui::Accelerator, TargetList> MediaKeysEventTargets;
+ MediaKeysEventTargets media_keys_event_targets_;
Finnur 2013/11/12 16:27:54 I think you should just use only the map you creat
zhchbin 2013/11/13 05:01:57 Yes. I have this idea before. My concern is that I
Finnur 2013/11/13 10:22:24 How about this... You make the change for Windows
zhchbin 2013/11/13 16:05:10 Done.
+
private:
// Returns true if the |extension| matches our extension filter.
bool ExtensionMatchesFilter(const extensions::Extension* extension);

Powered by Google App Engine
This is Rietveld 408576698