| 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_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/profiles/profile.h" | |
| 16 #include "chrome/browser/renderer_preferences_util.h" | |
| 17 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
| 18 #include "content/browser/renderer_host/render_process_host.h" | 16 #include "content/browser/renderer_host/render_process_host.h" |
| 19 #include "content/browser/renderer_host/render_view_host.h" | 17 #include "content/browser/renderer_host/render_view_host.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_view.h" | 18 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 21 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 19 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 22 #include "content/browser/site_instance.h" | 20 #include "content/browser/site_instance.h" |
| 23 #include "content/browser/tab_contents/navigation_controller.h" | 21 #include "content/browser/tab_contents/navigation_controller.h" |
| 24 #include "content/browser/tab_contents/navigation_entry.h" | 22 #include "content/browser/tab_contents/navigation_entry.h" |
| 25 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
| 26 #include "content/browser/tab_contents/tab_contents_view.h" | 24 #include "content/browser/tab_contents/tab_contents_view.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 reload_on_dont_proceed_(false), | 149 reload_on_dont_proceed_(false), |
| 152 enabled_(true), | 150 enabled_(true), |
| 153 action_taken_(NO_ACTION), | 151 action_taken_(NO_ACTION), |
| 154 render_view_host_(NULL), | 152 render_view_host_(NULL), |
| 155 original_child_id_(tab->render_view_host()->process()->id()), | 153 original_child_id_(tab->render_view_host()->process()->id()), |
| 156 original_rvh_id_(tab->render_view_host()->routing_id()), | 154 original_rvh_id_(tab->render_view_host()->routing_id()), |
| 157 should_revert_tab_title_(false), | 155 should_revert_tab_title_(false), |
| 158 resource_dispatcher_host_notified_(false), | 156 resource_dispatcher_host_notified_(false), |
| 159 ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( | 157 ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( |
| 160 new InterstitialPageRVHViewDelegate(this))) { | 158 new InterstitialPageRVHViewDelegate(this))) { |
| 161 renderer_preferences_util::UpdateFromSystemSettings( | |
| 162 &renderer_preferences_, tab_->profile()); | |
| 163 | |
| 164 InitInterstitialPageMap(); | 159 InitInterstitialPageMap(); |
| 165 // It would be inconsistent to create an interstitial with no new navigation | 160 // It would be inconsistent to create an interstitial with no new navigation |
| 166 // (which is the case when the interstitial was triggered by a sub-resource on | 161 // (which is the case when the interstitial was triggered by a sub-resource on |
| 167 // a page) when we have a pending entry (in the process of loading a new top | 162 // a page) when we have a pending entry (in the process of loading a new top |
| 168 // frame). | 163 // frame). |
| 169 DCHECK(new_navigation || !tab->controller().pending_entry()); | 164 DCHECK(new_navigation || !tab->controller().pending_entry()); |
| 170 } | 165 } |
| 171 | 166 |
| 172 InterstitialPage::~InterstitialPage() { | 167 InterstitialPage::~InterstitialPage() { |
| 173 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); | 168 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 | 723 |
| 729 void InterstitialPage::UpdateInspectorSetting(const std::string& key, | 724 void InterstitialPage::UpdateInspectorSetting(const std::string& key, |
| 730 const std::string& value) { | 725 const std::string& value) { |
| 731 RenderViewHostDelegateHelper::UpdateInspectorSetting( | 726 RenderViewHostDelegateHelper::UpdateInspectorSetting( |
| 732 tab_->profile(), key, value); | 727 tab_->profile(), key, value); |
| 733 } | 728 } |
| 734 | 729 |
| 735 void InterstitialPage::ClearInspectorSettings() { | 730 void InterstitialPage::ClearInspectorSettings() { |
| 736 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); | 731 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); |
| 737 } | 732 } |
| OLD | NEW |