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

Side by Side Diff: chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years 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 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob server.h" 5 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob server.h"
6 6
7 #include "chrome/browser/extensions/event_names.h" 7 #include "chrome/browser/extensions/event_names.h"
8 #include "chrome/browser/extensions/event_router.h" 8 #include "chrome/browser/extensions/event_router.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void ExtensionSyncEventObserver::BroadcastOrDispatchEvent( 132 void ExtensionSyncEventObserver::BroadcastOrDispatchEvent(
133 const GURL& app_origin, 133 const GURL& app_origin,
134 const std::string& event_name, 134 const std::string& event_name,
135 scoped_ptr<base::ListValue> values) { 135 scoped_ptr<base::ListValue> values) {
136 // Check to see whether the event should be broadcasted to all listening 136 // Check to see whether the event should be broadcasted to all listening
137 // extensions or sent to a specific extension ID. 137 // extensions or sent to a specific extension ID.
138 bool broadcast_mode = app_origin.is_empty(); 138 bool broadcast_mode = app_origin.is_empty();
139 EventRouter* event_router = ExtensionSystem::Get(profile_)->event_router(); 139 EventRouter* event_router = ExtensionSystem::Get(profile_)->event_router();
140 DCHECK(event_router); 140 DCHECK(event_router);
141 141
142 scoped_ptr<Event> event(new Event(event_name, values.Pass()));
143 event->restrict_to_profile = profile_;
144
142 // No app_origin, broadcast to all listening extensions for this event name. 145 // No app_origin, broadcast to all listening extensions for this event name.
143 if (broadcast_mode) { 146 if (broadcast_mode) {
144 event_router->DispatchEventToRenderers(event_name, values.Pass(), profile_, 147 event_router->BroadcastEvent(event.Pass());
145 GURL());
146 return; 148 return;
147 } 149 }
148 150
149 // Dispatch to single extension ID. 151 // Dispatch to single extension ID.
150 const std::string extension_id = GetExtensionId(app_origin); 152 const std::string extension_id = GetExtensionId(app_origin);
151 event_router->DispatchEventToExtension(extension_id, event_name, 153 event_router->DispatchEventToExtension(extension_id, event.Pass());
152 values.Pass(), profile_, GURL());
153 } 154 }
154 155
155 } // namespace extensions 156 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698