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

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

Issue 69883007: Extract chrome.runtime API code from extensions::EventRouter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 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_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EVENT_ROUTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // The ExtensionPrefs associated with |profile_|. May be NULL in tests. 272 // The ExtensionPrefs associated with |profile_|. May be NULL in tests.
273 ExtensionPrefs* extension_prefs_; 273 ExtensionPrefs* extension_prefs_;
274 274
275 content::NotificationRegistrar registrar_; 275 content::NotificationRegistrar registrar_;
276 276
277 EventListenerMap listeners_; 277 EventListenerMap listeners_;
278 278
279 typedef base::hash_map<std::string, Observer*> ObserverMap; 279 typedef base::hash_map<std::string, Observer*> ObserverMap;
280 ObserverMap observers_; 280 ObserverMap observers_;
281 281
282 // True if we should dispatch the chrome.runtime.onInstalled event with
283 // reason "chrome_update" upon loading each extension.
284 // TODO(jamescook): Move this to RuntimeEventRouter.
285 bool dispatch_chrome_updated_event_;
286
287 DISALLOW_COPY_AND_ASSIGN(EventRouter); 282 DISALLOW_COPY_AND_ASSIGN(EventRouter);
288 }; 283 };
289 284
290 struct Event { 285 struct Event {
291 typedef base::Callback<void(content::BrowserContext*, 286 typedef base::Callback<void(content::BrowserContext*,
292 const Extension*, 287 const Extension*,
293 base::ListValue*)> WillDispatchCallback; 288 base::ListValue*)> WillDispatchCallback;
294 289
295 // The event to dispatch. 290 // The event to dispatch.
296 std::string event_name; 291 std::string event_name;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 EventListenerInfo(const std::string& event_name, 340 EventListenerInfo(const std::string& event_name,
346 const std::string& extension_id); 341 const std::string& extension_id);
347 342
348 const std::string event_name; 343 const std::string event_name;
349 const std::string extension_id; 344 const std::string extension_id;
350 }; 345 };
351 346
352 } // namespace extensions 347 } // namespace extensions
353 348
354 #endif // CHROME_BROWSER_EXTENSIONS_EVENT_ROUTER_H_ 349 #endif // CHROME_BROWSER_EXTENSIONS_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698