| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( | 895 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( |
| 898 const LoadCommittedDetails& load_details) { | 896 const LoadCommittedDetails& load_details) { |
| 899 interstitial_->OnNavigatingAwayOrTabClosing(); | 897 interstitial_->OnNavigatingAwayOrTabClosing(); |
| 900 } | 898 } |
| 901 | 899 |
| 902 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { | 900 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { |
| 903 interstitial_->OnNavigatingAwayOrTabClosing(); | 901 interstitial_->OnNavigatingAwayOrTabClosing(); |
| 904 } | 902 } |
| 905 | 903 |
| 906 } // namespace content | 904 } // namespace content |
| OLD | NEW |