| 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/navigation_manager_impl.h" | 10 #import "ios/web/navigation/navigation_manager_impl.h" |
| 10 #import "ios/web/public/interstitials/web_interstitial_delegate.h" | 11 #import "ios/web/public/interstitials/web_interstitial_delegate.h" |
| 11 #import "ios/web/public/navigation_manager.h" | 12 #import "ios/web/public/navigation_manager.h" |
| 12 #include "ios/web/public/reload_type.h" | 13 #include "ios/web/public/reload_type.h" |
| 13 #import "ios/web/web_state/web_state_impl.h" | 14 #import "ios/web/web_state/web_state_impl.h" |
| 14 | 15 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
| 17 #endif | 18 #endif |
| 18 | 19 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 53 |
| 53 WebInterstitialFacadeDelegate* WebInterstitialImpl::GetFacadeDelegate() const { | 54 WebInterstitialFacadeDelegate* WebInterstitialImpl::GetFacadeDelegate() const { |
| 54 return facade_delegate_; | 55 return facade_delegate_; |
| 55 } | 56 } |
| 56 | 57 |
| 57 void WebInterstitialImpl::Show() { | 58 void WebInterstitialImpl::Show() { |
| 58 PrepareForDisplay(); | 59 PrepareForDisplay(); |
| 59 GetWebStateImpl()->ShowWebInterstitial(this); | 60 GetWebStateImpl()->ShowWebInterstitial(this); |
| 60 | 61 |
| 61 if (new_navigation_) { | 62 if (new_navigation_) { |
| 62 // TODO(crbug.com/706578): Plumb transient entry handling through | 63 // TODO(stuartmorgan): Plumb transient entry handling through |
| 63 // NavigationManager, and remove the NavigationManagerImpl usage here. | 64 // NavigationManager, and remove the NavigationManagerImpl and |
| 64 navigation_manager_->AddTransientItem(url_); | 65 // SessionController usage here. |
| 66 CRWSessionController* sessionController = |
| 67 navigation_manager_->GetSessionController(); |
| 68 [sessionController addTransientItemWithURL:url_]; |
| 65 | 69 |
| 66 // Give delegates a chance to set some states on the navigation item. | 70 // Give delegates a chance to set some states on the navigation item. |
| 67 GetDelegate()->OverrideItem(navigation_manager_->GetTransientItem()); | 71 GetDelegate()->OverrideItem(navigation_manager_->GetTransientItem()); |
| 68 } | 72 } |
| 69 } | 73 } |
| 70 | 74 |
| 71 void WebInterstitialImpl::Hide() { | 75 void WebInterstitialImpl::Hide() { |
| 72 GetWebStateImpl()->ClearTransientContentView(); | 76 GetWebStateImpl()->ClearTransientContentView(); |
| 73 } | 77 } |
| 74 | 78 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 101 | 105 |
| 102 void WebInterstitialImpl::WebStateDestroyed() { | 106 void WebInterstitialImpl::WebStateDestroyed() { |
| 103 DontProceed(); | 107 DontProceed(); |
| 104 } | 108 } |
| 105 | 109 |
| 106 WebStateImpl* WebInterstitialImpl::GetWebStateImpl() const { | 110 WebStateImpl* WebInterstitialImpl::GetWebStateImpl() const { |
| 107 return static_cast<web::WebStateImpl*>(web_state()); | 111 return static_cast<web::WebStateImpl*>(web_state()); |
| 108 } | 112 } |
| 109 | 113 |
| 110 } // namespace web | 114 } // namespace web |
| OLD | NEW |