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

Side by Side Diff: chrome/browser/extensions/extension_browser_event_router.h

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix. Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 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>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // Internal processing of tab updated events. Is called by both TabChangedAt 120 // Internal processing of tab updated events. Is called by both TabChangedAt
121 // and Observe/NAV_ENTRY_COMMITTED. 121 // and Observe/NAV_ENTRY_COMMITTED.
122 void TabUpdated(content::WebContents* contents, bool did_navigate); 122 void TabUpdated(content::WebContents* contents, bool did_navigate);
123 123
124 // The DispatchEvent methods forward events to the |profile|'s event router. 124 // The DispatchEvent methods forward events to the |profile|'s event router.
125 // The ExtensionBrowserEventRouter listens to events for all profiles, 125 // The ExtensionBrowserEventRouter listens to events for all profiles,
126 // so we avoid duplication by dropping events destined for other profiles. 126 // so we avoid duplication by dropping events destined for other profiles.
127 void DispatchEvent(Profile* profile, 127 void DispatchEvent(Profile* profile,
128 const char* event_name, 128 const char* event_name,
129 const std::string& json_args); 129 base::ListValue* arguments);
130 130
131 void DispatchEventToExtension(Profile* profile, 131 void DispatchEventToExtension(Profile* profile,
132 const std::string& extension_id, 132 const std::string& extension_id,
133 const char* event_name, 133 const char* event_name,
134 const std::string& json_args); 134 base::ListValue* event_args);
135 135
136 void DispatchEventsAcrossIncognito(Profile* profile, 136 void DispatchEventsAcrossIncognito(Profile* profile,
137 const char* event_name, 137 const char* event_name,
138 const std::string& json_args, 138 base::ListValue* event_args,
139 const std::string& cross_incognito_args); 139 base::ListValue* cross_incognito_args);
140 140
141 void DispatchEventWithTab(Profile* profile, 141 void DispatchEventWithTab(Profile* profile,
142 const std::string& extension_id, 142 const std::string& extension_id,
143 const char* event_name, 143 const char* event_name,
144 const content::WebContents* web_contents, 144 const content::WebContents* web_contents,
145 bool active); 145 bool active);
146 146
147 void DispatchSimpleBrowserEvent(Profile* profile, 147 void DispatchSimpleBrowserEvent(Profile* profile,
148 const int window_id, 148 const int window_id,
149 const char* event_name); 149 const char* event_name);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 Profile* focused_profile_; 234 Profile* focused_profile_;
235 235
236 // The currently focused window. We keep this so as to avoid sending multiple 236 // The currently focused window. We keep this so as to avoid sending multiple
237 // windows.onFocusChanged events with the same windowId. 237 // windows.onFocusChanged events with the same windowId.
238 int focused_window_id_; 238 int focused_window_id_;
239 239
240 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); 240 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter);
241 }; 241 };
242 242
243 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ 243 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698