diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 21:42:16 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 21:42:16 +0000 |
commit | aebdb3ec76fe3403eea5dd9f910396d86bf83983 (patch) | |
tree | 26bda5b0457ae3891f66acb998b8d5d1551ef6b4 /content | |
parent | 76c6a597cdcd375fed4a872cc802adcceb3eca15 (diff) | |
download | chromium_src-aebdb3ec76fe3403eea5dd9f910396d86bf83983.zip chromium_src-aebdb3ec76fe3403eea5dd9f910396d86bf83983.tar.gz chromium_src-aebdb3ec76fe3403eea5dd9f910396d86bf83983.tar.bz2 |
Fix the go-back and proceed actions for client side phishing interstitials.
These interstitials show after the page has finished loading, so we should treat them similarly to interstitials we show for blocked subresources. Also, tweak the main InterstitialPage class so that it won't call TabContents::SetIsLoading(true) unless the tab was loading at the time we showed the interstitial.
BUG=none
TEST=tested go back, proceed, and nav-away in the browser
Review URL: http://codereview.chromium.org/7071031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/tab_contents/interstitial_page.cc | 7 | ||||
-rw-r--r-- | content/browser/tab_contents/interstitial_page.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 3d86c38..4292f15 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -153,6 +153,7 @@ InterstitialPage::InterstitialPage(TabContents* tab, original_child_id_(tab->render_view_host()->process()->id()), original_rvh_id_(tab->render_view_host()->routing_id()), should_revert_tab_title_(false), + tab_was_loading_(false), resource_dispatcher_host_notified_(false), ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( new InterstitialPageRVHViewDelegate(this))) { @@ -378,6 +379,7 @@ void InterstitialPage::DidNavigate( // by the UI tests) expects to consider a navigation as complete. Without // this, navigating in a UI test to a URL that triggers an interstitial would // hang. + tab_was_loading_ = tab_->is_loading(); tab_->SetIsLoading(false, NULL); } @@ -442,8 +444,9 @@ void InterstitialPage::Proceed() { Disable(); action_taken_ = PROCEED_ACTION; - // Resumes the throbber. - tab_->SetIsLoading(true, NULL); + // Resumes the throbber, if applicable. + if (tab_was_loading_) + tab_->SetIsLoading(true, NULL); // If this is a new navigation, the old page is going away, so we cancel any // blocked requests for it. If it is not a new navigation, then it means the diff --git a/content/browser/tab_contents/interstitial_page.h b/content/browser/tab_contents/interstitial_page.h index 1340893..d9b06fe 100644 --- a/content/browser/tab_contents/interstitial_page.h +++ b/content/browser/tab_contents/interstitial_page.h @@ -219,6 +219,10 @@ class InterstitialPage : public NotificationObserver, // it to its original value). bool should_revert_tab_title_; + // Whether or not the tab was loading resources when the interstitial was + // shown. We restore this state if the user proceeds from the interstitial. + bool tab_was_loading_; + // Whether the ResourceDispatcherHost has been notified to cancel/resume the // resource requests blocked for the RenderViewHost. bool resource_dispatcher_host_notified_; |