OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/interstitial_page_impl.h" | 5 #include "content/browser/web_contents/interstitial_page_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 RenderWidgetHostView* old_view = | 243 RenderWidgetHostView* old_view = |
244 web_contents_->GetRenderViewHost()->GetView(); | 244 web_contents_->GetRenderViewHost()->GetView(); |
245 if (web_contents_->GetInterstitialPage() == this && | 245 if (web_contents_->GetInterstitialPage() == this && |
246 old_view && !old_view->IsShowing()) { | 246 old_view && !old_view->IsShowing()) { |
247 // Show the original RVH since we're going away. Note it might not exist if | 247 // Show the original RVH since we're going away. Note it might not exist if |
248 // the renderer crashed while the interstitial was showing. | 248 // the renderer crashed while the interstitial was showing. |
249 // Note that it is important that we don't call Show() if the view is | 249 // Note that it is important that we don't call Show() if the view is |
250 // already showing. That would result in bad things (unparented HWND on | 250 // already showing. That would result in bad things (unparented HWND on |
251 // Windows for example) happening. | 251 // Windows for example) happening. |
252 old_view->Show(); | 252 old_view->Show(); |
| 253 // WebContentsView implementations cached a pointer to the interstitial view |
| 254 // when we created it, so set the old original back. |
| 255 web_contents_->GetView()->SetView(old_view); |
253 } | 256 } |
254 | 257 |
255 // If the focus was on the interstitial, let's keep it to the page. | 258 // If the focus was on the interstitial, let's keep it to the page. |
256 // (Note that in unit-tests the RVH may not have a view). | 259 // (Note that in unit-tests the RVH may not have a view). |
257 if (render_view_host_->GetView() && | 260 if (render_view_host_->GetView() && |
258 render_view_host_->GetView()->HasFocus() && | 261 render_view_host_->GetView()->HasFocus() && |
259 web_contents_->GetRenderViewHost()->GetView()) { | 262 web_contents_->GetRenderViewHost()->GetView()) { |
260 RenderWidgetHostViewPort::FromRWHV( | 263 RenderWidgetHostViewPort::FromRWHV( |
261 web_contents_->GetRenderViewHost()->GetView())->Focus(); | 264 web_contents_->GetRenderViewHost()->GetView())->Focus(); |
262 } | 265 } |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 773 |
771 web_contents->GetDelegateView()->TakeFocus(reverse); | 774 web_contents->GetDelegateView()->TakeFocus(reverse); |
772 } | 775 } |
773 | 776 |
774 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( | 777 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( |
775 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 778 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
776 int active_match_ordinal, bool final_update) { | 779 int active_match_ordinal, bool final_update) { |
777 } | 780 } |
778 | 781 |
779 } // namespace content | 782 } // namespace content |
OLD | NEW |