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

Side by Side Diff: chrome/browser/extensions/extension_webnavigation_api.cc

Issue 6961027: Change event routers from singletons to being owned by the ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asargent and dmazzoni's comments Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/extension_webnavigation_api.h" 7 #include "chrome/browser/extensions/extension_webnavigation_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 for (FrameIdIterator frame_id = frame_ids.first; frame_id != frame_ids.second; 240 for (FrameIdIterator frame_id = frame_ids.first; frame_id != frame_ids.second;
241 ++frame_id) { 241 ++frame_id) {
242 frame_state_map_.erase(frame_id->second); 242 frame_state_map_.erase(frame_id->second);
243 } 243 }
244 tab_contents_map_.erase(tab_contents); 244 tab_contents_map_.erase(tab_contents);
245 } 245 }
246 246
247 247
248 // ExtensionWebNavigtionEventRouter ------------------------------------------- 248 // ExtensionWebNavigtionEventRouter -------------------------------------------
249 249
250 ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter() {}
251
252 ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {}
253
254 // static
255 ExtensionWebNavigationEventRouter*
256 ExtensionWebNavigationEventRouter::GetInstance() {
257 return Singleton<ExtensionWebNavigationEventRouter>::get();
258 }
259
260 void ExtensionWebNavigationEventRouter::Init() { 250 void ExtensionWebNavigationEventRouter::Init() {
261 if (registrar_.IsEmpty()) { 251 if (registrar_.IsEmpty()) {
262 registrar_.Add(this, 252 registrar_.Add(this,
263 NotificationType::CREATING_NEW_WINDOW, 253 NotificationType::CREATING_NEW_WINDOW,
264 NotificationService::AllSources()); 254 NotificationService::AllSources());
265 } 255 }
266 } 256 }
267 257
268 void ExtensionWebNavigationEventRouter::Observe( 258 void ExtensionWebNavigationEventRouter::Observe(
269 NotificationType type, 259 NotificationType type,
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 transition_type); 435 transition_type);
446 DispatchOnDOMContentLoaded(tab_contents(), 436 DispatchOnDOMContentLoaded(tab_contents(),
447 url, 437 url,
448 is_main_frame, 438 is_main_frame,
449 frame_id); 439 frame_id);
450 DispatchOnCompleted(tab_contents(), 440 DispatchOnCompleted(tab_contents(),
451 url, 441 url,
452 is_main_frame, 442 is_main_frame,
453 frame_id); 443 frame_id);
454 } 444 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698