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

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: Fix the test case!! 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..2e4c754db225195d060933811b59245d9acd74cd 100644
--- a/chrome/browser/extensions/extension_keybinding_registry.h
+++ b/chrome/browser/extensions/extension_keybinding_registry.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
+#include <list>
#include <map>
#include <string>
@@ -84,17 +85,23 @@ 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 NotifyEventTargets(const ui::Accelerator& accelerator);
+
// Notifies appropriate parties that a command has been executed.
void CommandExecuted(const std::string& extension_id,
const std::string& command);
- // Maps an accelerator to a string pair (extension id, command name) for
- // commands that have been registered. This keeps track of the targets for the
- // keybinding event (which named command to call in which extension). On GTK,
- // this map contains registration for pageAction and browserAction commands,
- // whereas on other platforms it does not.
- typedef std::map< ui::Accelerator,
- std::pair<std::string, std::string> > EventTargets;
+ // Maps an accelerator to a list of string pairs (extension id, command name)
+ // for commands that have been registered. This keeps track of the targets for
+ // the keybinding event (which named command to call in which extension). On
+ // GTK this map contains registration for pageAction and browserAction
+ // commands, whereas on other platforms it does not. Note that normal
+ // accelerator (which isn't media keys) has only one target, while the media
+ // keys can have more than one.
+ typedef std::list<std::pair<std::string, std::string> > TargetList;
+ typedef std::map<ui::Accelerator, TargetList> EventTargets;
EventTargets event_targets_;
private:

Powered by Google App Engine
This is Rietveld 408576698