OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const std::string& extension_id, | 92 const std::string& extension_id, |
93 const std::string& page_action_id, | 93 const std::string& page_action_id, |
94 int tab_id, | 94 int tab_id, |
95 const std::string& url, | 95 const std::string& url, |
96 int button); | 96 int button); |
97 // Browser Actions execute event. | 97 // Browser Actions execute event. |
98 void BrowserActionExecuted(Profile* profile, | 98 void BrowserActionExecuted(Profile* profile, |
99 const std::string& extension_id, | 99 const std::string& extension_id, |
100 Browser* browser); | 100 Browser* browser); |
101 | 101 |
| 102 // A keyboard shortcut resulted in an extension command. |
| 103 void CommandExecuted(Profile* profile, |
| 104 const std::string& extension_id, |
| 105 const std::string& command); |
| 106 |
102 // content::NotificationObserver. | 107 // content::NotificationObserver. |
103 virtual void Observe(int type, | 108 virtual void Observe(int type, |
104 const content::NotificationSource& source, | 109 const content::NotificationSource& source, |
105 const content::NotificationDetails& details) OVERRIDE; | 110 const content::NotificationDetails& details) OVERRIDE; |
106 private: | 111 private: |
107 // "Synthetic" event. Called from TabInsertedAt if new tab is detected. | 112 // "Synthetic" event. Called from TabInsertedAt if new tab is detected. |
108 void TabCreatedAt(content::WebContents* contents, int index, bool active); | 113 void TabCreatedAt(content::WebContents* contents, int index, bool active); |
109 | 114 |
110 // Internal processing of tab updated events. Is called by both TabChangedAt | 115 // Internal processing of tab updated events. Is called by both TabChangedAt |
111 // and Observe/NAV_ENTRY_COMMITTED. | 116 // and Observe/NAV_ENTRY_COMMITTED. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 Profile* focused_profile_; | 223 Profile* focused_profile_; |
219 | 224 |
220 // The currently focused window. We keep this so as to avoid sending multiple | 225 // The currently focused window. We keep this so as to avoid sending multiple |
221 // windows.onFocusChanged events with the same windowId. | 226 // windows.onFocusChanged events with the same windowId. |
222 int focused_window_id_; | 227 int focused_window_id_; |
223 | 228 |
224 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); | 229 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); |
225 }; | 230 }; |
226 | 231 |
227 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 232 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |