| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // ExtensionWebNavigtionEventRouter ------------------------------------------- | 248 // ExtensionWebNavigtionEventRouter ------------------------------------------- |
| 249 | 249 |
| 250 ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter( | 250 ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter( |
| 251 Profile* profile) : profile_(profile) {} | 251 Profile* profile) : profile_(profile) {} |
| 252 | 252 |
| 253 ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {} | 253 ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {} |
| 254 | 254 |
| 255 void ExtensionWebNavigationEventRouter::Init() { | 255 void ExtensionWebNavigationEventRouter::Init() { |
| 256 if (registrar_.IsEmpty()) { | 256 if (registrar_.IsEmpty()) { |
| 257 registrar_.Add(this, | 257 registrar_.Add(this, |
| 258 NotificationType::CREATING_NEW_WINDOW, | 258 content::NOTIFICATION_CREATING_NEW_WINDOW, |
| 259 NotificationService::AllSources()); | 259 NotificationService::AllSources()); |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ExtensionWebNavigationEventRouter::Observe( | 263 void ExtensionWebNavigationEventRouter::Observe( |
| 264 NotificationType type, | 264 int type, |
| 265 const NotificationSource& source, | 265 const NotificationSource& source, |
| 266 const NotificationDetails& details) { | 266 const NotificationDetails& details) { |
| 267 switch (type.value) { | 267 switch (type) { |
| 268 case NotificationType::CREATING_NEW_WINDOW: | 268 case content::NOTIFICATION_CREATING_NEW_WINDOW: |
| 269 CreatingNewWindow( | 269 CreatingNewWindow( |
| 270 Source<TabContents>(source).ptr(), | 270 Source<TabContents>(source).ptr(), |
| 271 Details<const ViewHostMsg_CreateWindow_Params>(details).ptr()); | 271 Details<const ViewHostMsg_CreateWindow_Params>(details).ptr()); |
| 272 break; | 272 break; |
| 273 | 273 |
| 274 default: | 274 default: |
| 275 NOTREACHED(); | 275 NOTREACHED(); |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 | 278 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 transition_type); | 442 transition_type); |
| 443 DispatchOnDOMContentLoaded(tab_contents(), | 443 DispatchOnDOMContentLoaded(tab_contents(), |
| 444 url, | 444 url, |
| 445 is_main_frame, | 445 is_main_frame, |
| 446 frame_id); | 446 frame_id); |
| 447 DispatchOnCompleted(tab_contents(), | 447 DispatchOnCompleted(tab_contents(), |
| 448 url, | 448 url, |
| 449 is_main_frame, | 449 is_main_frame, |
| 450 frame_id); | 450 frame_id); |
| 451 } | 451 } |
| OLD | NEW |