| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/time.h" | 10 #include "base/time.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/extensions/extension_event_router.h" | 12 #include "chrome/browser/extensions/extension_event_router.h" |
| 13 #include "chrome/browser/extensions/extension_tabs_module.h" | 13 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 14 #include "chrome/browser/extensions/extension_webnavigation_api_constants.h" | 14 #include "chrome/browser/extensions/extension_webnavigation_api_constants.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/tab_contents/navigation_controller.h" | |
| 17 #include "chrome/browser/tab_contents/provisional_load_details.h" | |
| 18 #include "chrome/browser/tab_contents/tab_contents.h" | |
| 19 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
| 20 #include "chrome/common/render_messages_params.h" | 17 #include "chrome/common/render_messages_params.h" |
| 18 #include "content/browser/tab_contents/navigation_controller.h" |
| 19 #include "content/browser/tab_contents/provisional_load_details.h" |
| 20 #include "content/browser/tab_contents/tab_contents.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 | 22 |
| 23 namespace keys = extension_webnavigation_api_constants; | 23 namespace keys = extension_webnavigation_api_constants; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Returns 0 if the navigation happens in the main frame, or the frame ID | 27 // Returns 0 if the navigation happens in the main frame, or the frame ID |
| 28 // modulo 32 bits otherwise. | 28 // modulo 32 bits otherwise. |
| 29 int GetFrameId(ProvisionalLoadDetails* details) { | 29 int GetFrameId(ProvisionalLoadDetails* details) { |
| 30 return details->main_frame() ? 0 : static_cast<int>(details->frame_id()); | 30 return details->main_frame() ? 0 : static_cast<int>(details->frame_id()); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 DispatchOnCommitted(controller, details); | 388 DispatchOnCommitted(controller, details); |
| 389 DispatchOnDOMContentLoaded(controller, | 389 DispatchOnDOMContentLoaded(controller, |
| 390 details->url(), | 390 details->url(), |
| 391 details->main_frame(), | 391 details->main_frame(), |
| 392 details->frame_id()); | 392 details->frame_id()); |
| 393 DispatchOnCompleted(controller, | 393 DispatchOnCompleted(controller, |
| 394 details->url(), | 394 details->url(), |
| 395 details->main_frame(), | 395 details->main_frame(), |
| 396 details->frame_id()); | 396 details->frame_id()); |
| 397 } | 397 } |
| OLD | NEW |