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

Side by Side Diff: chrome/browser/extensions/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: Fixing memory leak in a test. Created 8 years, 4 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_BROWSER_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 // Internal processing of tab updated events. Is called by both TabChangedAt 101 // Internal processing of tab updated events. Is called by both TabChangedAt
102 // and Observe/NAV_ENTRY_COMMITTED. 102 // and Observe/NAV_ENTRY_COMMITTED.
103 void TabUpdated(content::WebContents* contents, bool did_navigate); 103 void TabUpdated(content::WebContents* contents, bool did_navigate);
104 104
105 // The DispatchEvent methods forward events to the |profile|'s event router. 105 // The DispatchEvent methods forward events to the |profile|'s event router.
106 // The BrowserEventRouter listens to events for all profiles, 106 // The BrowserEventRouter listens to events for all profiles,
107 // so we avoid duplication by dropping events destined for other profiles. 107 // so we avoid duplication by dropping events destined for other profiles.
108 void DispatchEvent(Profile* profile, 108 void DispatchEvent(Profile* profile,
109 const char* event_name, 109 const char* event_name,
110 const std::string& json_args, 110 scoped_ptr<base::ListValue> args,
111 EventRouter::UserGestureState user_gesture); 111 EventRouter::UserGestureState user_gesture);
112 112
113 void DispatchEventToExtension(Profile* profile, 113 void DispatchEventToExtension(Profile* profile,
114 const std::string& extension_id, 114 const std::string& extension_id,
115 const char* event_name, 115 const char* event_name,
116 const std::string& json_args, 116 scoped_ptr<base::ListValue> event_args,
117 EventRouter::UserGestureState user_gesture); 117 EventRouter::UserGestureState user_gesture);
118 118
119 void DispatchEventsAcrossIncognito(Profile* profile, 119 void DispatchEventsAcrossIncognito(
120 const char* event_name, 120 Profile* profile,
121 const std::string& json_args, 121 const char* event_name,
122 const std::string& cross_incognito_args); 122 scoped_ptr<base::ListValue> event_args,
123 scoped_ptr<base::ListValue> cross_incognito_args);
123 124
124 void DispatchEventWithTab(Profile* profile, 125 void DispatchEventWithTab(Profile* profile,
125 const std::string& extension_id, 126 const std::string& extension_id,
126 const char* event_name, 127 const char* event_name,
127 const content::WebContents* web_contents, 128 const content::WebContents* web_contents,
128 bool active, 129 bool active,
129 EventRouter::UserGestureState user_gesture); 130 EventRouter::UserGestureState user_gesture);
130 131
131 void DispatchSimpleBrowserEvent(Profile* profile, 132 void DispatchSimpleBrowserEvent(Profile* profile,
132 const int window_id, 133 const int window_id,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 212
212 // The main profile that owns this event router. 213 // The main profile that owns this event router.
213 Profile* profile_; 214 Profile* profile_;
214 215
215 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); 216 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter);
216 }; 217 };
217 218
218 } // namespace extensions 219 } // namespace extensions
219 220
220 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ 221 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698