| 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 <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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  476     // Hide the original RVH since we're showing the interstitial instead. |  476     // Hide the original RVH since we're showing the interstitial instead. | 
|  477     rwh_view->Hide(); |  477     rwh_view->Hide(); | 
|  478   } |  478   } | 
|  479  |  479  | 
|  480   // Notify the tab we are not loading so the throbber is stopped. It also |  480   // Notify the tab we are not loading so the throbber is stopped. It also | 
|  481   // causes a WebContentsObserver::DidStopLoading callback that the |  481   // causes a WebContentsObserver::DidStopLoading callback that the | 
|  482   // AutomationProvider (used by the UI tests) expects to consider a navigation |  482   // AutomationProvider (used by the UI tests) expects to consider a navigation | 
|  483   // as complete. Without this, navigating in a UI test to a URL that triggers |  483   // as complete. Without this, navigating in a UI test to a URL that triggers | 
|  484   // an interstitial would hang. |  484   // an interstitial would hang. | 
|  485   web_contents_was_loading_ = controller_->delegate()->IsLoading(); |  485   web_contents_was_loading_ = controller_->delegate()->IsLoading(); | 
|  486   controller_->delegate()->SetIsLoading( |  486   controller_->delegate()->SetIsLoading(false, true, NULL); | 
|  487       controller_->delegate()->GetRenderViewHost(), false, true, NULL); |  | 
|  488 } |  487 } | 
|  489  |  488  | 
|  490 RendererPreferences InterstitialPageImpl::GetRendererPrefs( |  489 RendererPreferences InterstitialPageImpl::GetRendererPrefs( | 
|  491     BrowserContext* browser_context) const { |  490     BrowserContext* browser_context) const { | 
|  492   delegate_->OverrideRendererPrefs(&renderer_preferences_); |  491   delegate_->OverrideRendererPrefs(&renderer_preferences_); | 
|  493   return renderer_preferences_; |  492   return renderer_preferences_; | 
|  494 } |  493 } | 
|  495  |  494  | 
|  496 void InterstitialPageImpl::RenderWidgetDeleted( |  495 void InterstitialPageImpl::RenderWidgetDeleted( | 
|  497     RenderWidgetHostImpl* render_widget_host) { |  496     RenderWidgetHostImpl* render_widget_host) { | 
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  584  |  583  | 
|  585   if (action_taken_ != NO_ACTION) { |  584   if (action_taken_ != NO_ACTION) { | 
|  586     NOTREACHED(); |  585     NOTREACHED(); | 
|  587     return; |  586     return; | 
|  588   } |  587   } | 
|  589   Disable(); |  588   Disable(); | 
|  590   action_taken_ = PROCEED_ACTION; |  589   action_taken_ = PROCEED_ACTION; | 
|  591  |  590  | 
|  592   // Resumes the throbber, if applicable. |  591   // Resumes the throbber, if applicable. | 
|  593   if (web_contents_was_loading_) |  592   if (web_contents_was_loading_) | 
|  594     controller_->delegate()->SetIsLoading( |  593     controller_->delegate()->SetIsLoading(true, true, NULL); | 
|  595         controller_->delegate()->GetRenderViewHost(), true, true, NULL); |  | 
|  596  |  594  | 
|  597   // If this is a new navigation, the old page is going away, so we cancel any |  595   // If this is a new navigation, the old page is going away, so we cancel any | 
|  598   // blocked requests for it.  If it is not a new navigation, then it means the |  596   // blocked requests for it.  If it is not a new navigation, then it means the | 
|  599   // interstitial was shown as a result of a resource loading in the page. |  597   // interstitial was shown as a result of a resource loading in the page. | 
|  600   // Since the user wants to proceed, we'll let any blocked request go through. |  598   // Since the user wants to proceed, we'll let any blocked request go through. | 
|  601   if (new_navigation_) |  599   if (new_navigation_) | 
|  602     TakeActionOnResourceDispatcher(CANCEL); |  600     TakeActionOnResourceDispatcher(CANCEL); | 
|  603   else |  601   else | 
|  604     TakeActionOnResourceDispatcher(RESUME); |  602     TakeActionOnResourceDispatcher(RESUME); | 
|  605  |  603  | 
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  896 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( |  894 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( | 
|  897     const LoadCommittedDetails& load_details) { |  895     const LoadCommittedDetails& load_details) { | 
|  898   interstitial_->OnNavigatingAwayOrTabClosing(); |  896   interstitial_->OnNavigatingAwayOrTabClosing(); | 
|  899 } |  897 } | 
|  900  |  898  | 
|  901 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { |  899 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { | 
|  902   interstitial_->OnNavigatingAwayOrTabClosing(); |  900   interstitial_->OnNavigatingAwayOrTabClosing(); | 
|  903 } |  901 } | 
|  904  |  902  | 
|  905 }  // namespace content |  903 }  // namespace content | 
| OLD | NEW |