| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/web/interstitials/web_interstitial_impl.h" | 5 #import "ios/web/interstitials/web_interstitial_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ios/web/interstitials/web_interstitial_facade_delegate.h" | 8 #include "ios/web/interstitials/web_interstitial_facade_delegate.h" |
| 9 #import "ios/web/navigation/crw_session_controller.h" | 9 #import "ios/web/navigation/crw_session_controller.h" |
| 10 #import "ios/web/navigation/navigation_manager_impl.h" | 10 #import "ios/web/navigation/navigation_manager_impl.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void WebInterstitialImpl::Show() { | 57 void WebInterstitialImpl::Show() { |
| 58 PrepareForDisplay(); | 58 PrepareForDisplay(); |
| 59 GetWebStateImpl()->ShowWebInterstitial(this); | 59 GetWebStateImpl()->ShowWebInterstitial(this); |
| 60 | 60 |
| 61 if (new_navigation_) { | 61 if (new_navigation_) { |
| 62 // TODO(stuartmorgan): Plumb transient entry handling through | 62 // TODO(stuartmorgan): Plumb transient entry handling through |
| 63 // NavigationManager, and remove the NavigationManagerImpl and | 63 // NavigationManager, and remove the NavigationManagerImpl and |
| 64 // SessionController usage here. | 64 // SessionController usage here. |
| 65 CRWSessionController* sessionController = | 65 CRWSessionController* sessionController = |
| 66 navigation_manager_->GetSessionController(); | 66 navigation_manager_->GetSessionController(); |
| 67 [sessionController addTransientEntryWithURL:url_]; | 67 [sessionController addTransientItemWithURL:url_]; |
| 68 | 68 |
| 69 // Give delegates a chance to set some states on the navigation item. | 69 // Give delegates a chance to set some states on the navigation item. |
| 70 GetDelegate()->OverrideItem(navigation_manager_->GetTransientItem()); | 70 GetDelegate()->OverrideItem(navigation_manager_->GetTransientItem()); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void WebInterstitialImpl::Hide() { | 74 void WebInterstitialImpl::Hide() { |
| 75 GetWebStateImpl()->ClearTransientContentView(); | 75 GetWebStateImpl()->ClearTransientContentView(); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 108 | 108 |
| 109 void WebInterstitialImpl::WebStateDestroyed() { | 109 void WebInterstitialImpl::WebStateDestroyed() { |
| 110 DontProceed(); | 110 DontProceed(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 WebStateImpl* WebInterstitialImpl::GetWebStateImpl() const { | 113 WebStateImpl* WebInterstitialImpl::GetWebStateImpl() const { |
| 114 return static_cast<web::WebStateImpl*>(web_state()); | 114 return static_cast<web::WebStateImpl*>(web_state()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace web | 117 } // namespace web |
| OLD | NEW |