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