Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: content/browser/web_contents/interstitial_page_impl.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // (Note that in unit-tests the RVH may not have a view). 261 // (Note that in unit-tests the RVH may not have a view).
262 if (render_view_host_->GetView() && 262 if (render_view_host_->GetView() &&
263 render_view_host_->GetView()->HasFocus() && 263 render_view_host_->GetView()->HasFocus() &&
264 web_contents_->GetRenderViewHost()->GetView()) { 264 web_contents_->GetRenderViewHost()->GetView()) {
265 RenderWidgetHostViewPort::FromRWHV( 265 RenderWidgetHostViewPort::FromRWHV(
266 web_contents_->GetRenderViewHost()->GetView())->Focus(); 266 web_contents_->GetRenderViewHost()->GetView())->Focus();
267 } 267 }
268 268
269 // Shutdown the RVH asynchronously, as we may have been called from a RVH 269 // Shutdown the RVH asynchronously, as we may have been called from a RVH
270 // delegate method, and we can't delete the RVH out from under itself. 270 // delegate method, and we can't delete the RVH out from under itself.
271 MessageLoop::current()->PostNonNestableTask(FROM_HERE, 271 base::MessageLoop::current()->PostNonNestableTask(
272 FROM_HERE,
272 base::Bind(&InterstitialPageImpl::Shutdown, 273 base::Bind(&InterstitialPageImpl::Shutdown,
273 weak_ptr_factory_.GetWeakPtr(), 274 weak_ptr_factory_.GetWeakPtr(),
274 render_view_host_)); 275 render_view_host_));
275 render_view_host_ = NULL; 276 render_view_host_ = NULL;
276 web_contents_->DetachInterstitialPage(); 277 web_contents_->DetachInterstitialPage();
277 // Let's revert to the original title if necessary. 278 // Let's revert to the original title if necessary.
278 NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); 279 NavigationEntry* entry = web_contents_->GetController().GetActiveEntry();
279 if (!new_navigation_ && should_revert_web_contents_title_) { 280 if (!new_navigation_ && should_revert_web_contents_title_) {
280 entry->SetTitle(original_web_contents_title_); 281 entry->SetTitle(original_web_contents_title_);
281 web_contents_->NotifyNavigationStateChanged(INVALIDATE_TYPE_TITLE); 282 web_contents_->NotifyNavigationStateChanged(INVALIDATE_TYPE_TITLE);
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 800
800 web_contents->GetDelegateView()->TakeFocus(reverse); 801 web_contents->GetDelegateView()->TakeFocus(reverse);
801 } 802 }
802 803
803 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( 804 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply(
804 int request_id, int number_of_matches, const gfx::Rect& selection_rect, 805 int request_id, int number_of_matches, const gfx::Rect& selection_rect,
805 int active_match_ordinal, bool final_update) { 806 int active_match_ordinal, bool final_update) {
806 } 807 }
807 808
808 } // namespace content 809 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/udev_linux.cc ('k') | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698