OLD | NEW |
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() {} | 250 ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter() {} |
251 | 251 |
252 ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {} | 252 ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {} |
253 | 253 |
254 // static | |
255 ExtensionWebNavigationEventRouter* | |
256 ExtensionWebNavigationEventRouter::GetInstance() { | |
257 return Singleton<ExtensionWebNavigationEventRouter>::get(); | |
258 } | |
259 | |
260 void ExtensionWebNavigationEventRouter::Init() { | 254 void ExtensionWebNavigationEventRouter::Init() { |
261 if (registrar_.IsEmpty()) { | 255 if (registrar_.IsEmpty()) { |
262 registrar_.Add(this, | 256 registrar_.Add(this, |
263 NotificationType::CREATING_NEW_WINDOW, | 257 NotificationType::CREATING_NEW_WINDOW, |
264 NotificationService::AllSources()); | 258 NotificationService::AllSources()); |
265 } | 259 } |
266 } | 260 } |
267 | 261 |
268 void ExtensionWebNavigationEventRouter::Observe( | 262 void ExtensionWebNavigationEventRouter::Observe( |
269 NotificationType type, | 263 NotificationType type, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 transition_type); | 439 transition_type); |
446 DispatchOnDOMContentLoaded(tab_contents(), | 440 DispatchOnDOMContentLoaded(tab_contents(), |
447 url, | 441 url, |
448 is_main_frame, | 442 is_main_frame, |
449 frame_id); | 443 frame_id); |
450 DispatchOnCompleted(tab_contents(), | 444 DispatchOnCompleted(tab_contents(), |
451 url, | 445 url, |
452 is_main_frame, | 446 is_main_frame, |
453 frame_id); | 447 frame_id); |
454 } | 448 } |
OLD | NEW |