| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/interstitial_page_impl.h" | 5 #include "content/browser/frame_host/interstitial_page_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "content/browser/renderer_host/render_process_host_impl.h" | 26 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 27 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 27 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 28 #include "content/browser/renderer_host/render_view_host_factory.h" | 28 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 29 #include "content/browser/renderer_host/render_view_host_impl.h" | 29 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 30 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 30 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 31 #include "content/browser/site_instance_impl.h" | 31 #include "content/browser/site_instance_impl.h" |
| 32 #include "content/browser/web_contents/web_contents_impl.h" | 32 #include "content/browser/web_contents/web_contents_impl.h" |
| 33 #include "content/browser/web_contents/web_contents_view.h" | 33 #include "content/browser/web_contents/web_contents_view.h" |
| 34 #include "content/common/frame_messages.h" | 34 #include "content/common/frame_messages.h" |
| 35 #include "content/common/input_messages.h" | 35 #include "content/common/input_messages.h" |
| 36 #include "content/common/text_input_state.h" | |
| 37 #include "content/common/view_messages.h" | 36 #include "content/common/view_messages.h" |
| 38 #include "content/public/browser/browser_context.h" | 37 #include "content/public/browser/browser_context.h" |
| 39 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/content_browser_client.h" | 39 #include "content/public/browser/content_browser_client.h" |
| 41 #include "content/public/browser/interstitial_page_delegate.h" | 40 #include "content/public/browser/interstitial_page_delegate.h" |
| 42 #include "content/public/browser/invalidate_type.h" | 41 #include "content/public/browser/invalidate_type.h" |
| 43 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 44 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| 45 #include "content/public/browser/storage_partition.h" | 44 #include "content/public/browser/storage_partition.h" |
| 46 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 this, | 164 this, |
| 166 static_cast<WebContentsImpl*>(web_contents)), | 165 static_cast<WebContentsImpl*>(web_contents)), |
| 167 original_child_id_(web_contents->GetRenderProcessHost()->GetID()), | 166 original_child_id_(web_contents->GetRenderProcessHost()->GetID()), |
| 168 original_rvh_id_(web_contents->GetRenderViewHost()->GetRoutingID()), | 167 original_rvh_id_(web_contents->GetRenderViewHost()->GetRoutingID()), |
| 169 should_revert_web_contents_title_(false), | 168 should_revert_web_contents_title_(false), |
| 170 resource_dispatcher_host_notified_(false), | 169 resource_dispatcher_host_notified_(false), |
| 171 rvh_delegate_view_(new InterstitialPageRVHDelegateView(this)), | 170 rvh_delegate_view_(new InterstitialPageRVHDelegateView(this)), |
| 172 create_view_(true), | 171 create_view_(true), |
| 173 pause_throbber_(false), | 172 pause_throbber_(false), |
| 174 delegate_(delegate), | 173 delegate_(delegate), |
| 175 text_input_state_(new TextInputState()), | |
| 176 weak_ptr_factory_(this) { | 174 weak_ptr_factory_(this) { |
| 177 InitInterstitialPageMap(); | 175 InitInterstitialPageMap(); |
| 178 } | 176 } |
| 179 | 177 |
| 180 InterstitialPageImpl::~InterstitialPageImpl() { | 178 InterstitialPageImpl::~InterstitialPageImpl() { |
| 181 } | 179 } |
| 182 | 180 |
| 183 void InterstitialPageImpl::Show() { | 181 void InterstitialPageImpl::Show() { |
| 184 if (!enabled()) | 182 if (!enabled()) |
| 185 return; | 183 return; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 delegate_->OverrideRendererPrefs(&renderer_preferences_); | 530 delegate_->OverrideRendererPrefs(&renderer_preferences_); |
| 533 return renderer_preferences_; | 531 return renderer_preferences_; |
| 534 } | 532 } |
| 535 | 533 |
| 536 void InterstitialPageImpl::RenderWidgetDeleted( | 534 void InterstitialPageImpl::RenderWidgetDeleted( |
| 537 RenderWidgetHostImpl* render_widget_host) { | 535 RenderWidgetHostImpl* render_widget_host) { |
| 538 // TODO(creis): Remove this method once we verify the shutdown path is sane. | 536 // TODO(creis): Remove this method once we verify the shutdown path is sane. |
| 539 CHECK(!web_contents_); | 537 CHECK(!web_contents_); |
| 540 } | 538 } |
| 541 | 539 |
| 542 const TextInputState* InterstitialPageImpl::GetTextInputState() { | |
| 543 return text_input_state_.get(); | |
| 544 } | |
| 545 | |
| 546 void InterstitialPageImpl::UpdateTextInputState(RenderWidgetHostViewBase* rwhv, | |
| 547 bool text_input_state_changed) { | |
| 548 if (web_contents_) { | |
| 549 WebContentsImpl* contents = static_cast<WebContentsImpl*>(web_contents_); | |
| 550 contents->UpdateTextInputState(rwhv, text_input_state_changed); | |
| 551 *text_input_state_ = *contents->GetTextInputState(); | |
| 552 } | |
| 553 } | |
| 554 | |
| 555 bool InterstitialPageImpl::PreHandleKeyboardEvent( | 540 bool InterstitialPageImpl::PreHandleKeyboardEvent( |
| 556 const NativeWebKeyboardEvent& event, | 541 const NativeWebKeyboardEvent& event, |
| 557 bool* is_keyboard_shortcut) { | 542 bool* is_keyboard_shortcut) { |
| 558 if (!enabled()) | 543 if (!enabled()) |
| 559 return false; | 544 return false; |
| 560 return render_widget_host_delegate_->PreHandleKeyboardEvent( | 545 return render_widget_host_delegate_->PreHandleKeyboardEvent( |
| 561 event, is_keyboard_shortcut); | 546 event, is_keyboard_shortcut); |
| 562 } | 547 } |
| 563 | 548 |
| 564 void InterstitialPageImpl::HandleKeyboardEvent( | 549 void InterstitialPageImpl::HandleKeyboardEvent( |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( | 924 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( |
| 940 const LoadCommittedDetails& load_details) { | 925 const LoadCommittedDetails& load_details) { |
| 941 interstitial_->OnNavigatingAwayOrTabClosing(); | 926 interstitial_->OnNavigatingAwayOrTabClosing(); |
| 942 } | 927 } |
| 943 | 928 |
| 944 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { | 929 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { |
| 945 interstitial_->OnNavigatingAwayOrTabClosing(); | 930 interstitial_->OnNavigatingAwayOrTabClosing(); |
| 946 } | 931 } |
| 947 | 932 |
| 948 } // namespace content | 933 } // namespace content |
| OLD | NEW |