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 #include "content/browser/tab_contents/interstitial_page.h" | 5 #include "content/browser/tab_contents/interstitial_page.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/dom_operation_notification_details.h" | 16 #include "chrome/browser/dom_operation_notification_details.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/renderer_preferences_util.h" | 18 #include "chrome/browser/renderer_preferences_util.h" |
19 #include "chrome/common/bindings_policy.h" | 19 #include "chrome/common/bindings_policy.h" |
20 #include "chrome/common/dom_storage_common.h" | 20 #include "chrome/common/dom_storage_common.h" |
21 #include "chrome/common/net/url_request_context_getter.h" | 21 #include "chrome/common/net/url_request_context_getter.h" |
| 22 #include "chrome/common/page_transition_types.h" |
| 23 #include "chrome/common/render_messages_params.h" |
22 #include "content/browser/browser_thread.h" | 24 #include "content/browser/browser_thread.h" |
23 #include "content/browser/renderer_host/render_process_host.h" | 25 #include "content/browser/renderer_host/render_process_host.h" |
24 #include "content/browser/renderer_host/render_view_host.h" | 26 #include "content/browser/renderer_host/render_view_host.h" |
25 #include "content/browser/renderer_host/render_widget_host_view.h" | 27 #include "content/browser/renderer_host/render_widget_host_view.h" |
26 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 28 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
27 #include "content/browser/site_instance.h" | 29 #include "content/browser/site_instance.h" |
28 #include "content/browser/tab_contents/navigation_controller.h" | 30 #include "content/browser/tab_contents/navigation_controller.h" |
29 #include "content/browser/tab_contents/navigation_entry.h" | 31 #include "content/browser/tab_contents/navigation_entry.h" |
30 #include "content/browser/tab_contents/tab_contents.h" | 32 #include "content/browser/tab_contents/tab_contents.h" |
31 #include "content/browser/tab_contents/tab_contents_view.h" | 33 #include "content/browser/tab_contents/tab_contents_view.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 void InterstitialPage::DidNavigate( | 346 void InterstitialPage::DidNavigate( |
345 RenderViewHost* render_view_host, | 347 RenderViewHost* render_view_host, |
346 const ViewHostMsg_FrameNavigate_Params& params) { | 348 const ViewHostMsg_FrameNavigate_Params& params) { |
347 // A fast user could have navigated away from the page that triggered the | 349 // A fast user could have navigated away from the page that triggered the |
348 // interstitial while the interstitial was loading, that would have disabled | 350 // interstitial while the interstitial was loading, that would have disabled |
349 // us. In that case we can dismiss ourselves. | 351 // us. In that case we can dismiss ourselves. |
350 if (!enabled_) { | 352 if (!enabled_) { |
351 DontProceed(); | 353 DontProceed(); |
352 return; | 354 return; |
353 } | 355 } |
| 356 if (params.transition == PageTransition::AUTO_SUBFRAME) { |
| 357 // No need to handle navigate message from iframe in the interstitial page. |
| 358 return; |
| 359 } |
354 | 360 |
355 // The RenderViewHost has loaded its contents, we can show it now. | 361 // The RenderViewHost has loaded its contents, we can show it now. |
356 render_view_host_->view()->Show(); | 362 render_view_host_->view()->Show(); |
357 tab_->set_interstitial_page(this); | 363 tab_->set_interstitial_page(this); |
358 | 364 |
359 NotificationService::current()->Notify( | 365 NotificationService::current()->Notify( |
360 NotificationType::INTERSTITIAL_ATTACHED, | 366 NotificationType::INTERSTITIAL_ATTACHED, |
361 Source<TabContents>(tab_), | 367 Source<TabContents>(tab_), |
362 NotificationService::NoDetails()); | 368 NotificationService::NoDetails()); |
363 | 369 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 735 |
730 void InterstitialPage::UpdateInspectorSetting(const std::string& key, | 736 void InterstitialPage::UpdateInspectorSetting(const std::string& key, |
731 const std::string& value) { | 737 const std::string& value) { |
732 RenderViewHostDelegateHelper::UpdateInspectorSetting( | 738 RenderViewHostDelegateHelper::UpdateInspectorSetting( |
733 tab_->profile(), key, value); | 739 tab_->profile(), key, value); |
734 } | 740 } |
735 | 741 |
736 void InterstitialPage::ClearInspectorSettings() { | 742 void InterstitialPage::ClearInspectorSettings() { |
737 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); | 743 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); |
738 } | 744 } |
OLD | NEW |