| 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 #include "ios/web/interstitials/native_web_interstitial_impl.h" | 5 #include "ios/web/interstitials/native_web_interstitial_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ios/web/public/interstitials/web_interstitial_delegate.h" | 10 #include "ios/web/public/interstitials/web_interstitial_delegate.h" |
| 11 #import "ios/web/public/web_state/ui/crw_generic_content_view.h" | 11 #import "ios/web/public/web_state/ui/crw_generic_content_view.h" |
| 12 #include "ios/web/web_state/web_state_impl.h" | 12 #include "ios/web/web_state/web_state_impl.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
| 15 namespace web { | 19 namespace web { |
| 16 | 20 |
| 17 // static | 21 // static |
| 18 WebInterstitial* WebInterstitial::CreateNativeInterstitial( | 22 WebInterstitial* WebInterstitial::CreateNativeInterstitial( |
| 19 WebState* web_state, | 23 WebState* web_state, |
| 20 bool new_navigation, | 24 bool new_navigation, |
| 21 const GURL& url, | 25 const GURL& url, |
| 22 std::unique_ptr<NativeWebInterstitialDelegate> delegate) { | 26 std::unique_ptr<NativeWebInterstitialDelegate> delegate) { |
| 23 WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state); | 27 WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state); |
| 24 return new NativeWebInterstitialImpl(web_state_impl, new_navigation, url, | 28 return new NativeWebInterstitialImpl(web_state_impl, new_navigation, url, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 53 return delegate_.get(); | 57 return delegate_.get(); |
| 54 } | 58 } |
| 55 | 59 |
| 56 void NativeWebInterstitialImpl::EvaluateJavaScript( | 60 void NativeWebInterstitialImpl::EvaluateJavaScript( |
| 57 NSString* script, | 61 NSString* script, |
| 58 JavaScriptCompletion completionHandler) { | 62 JavaScriptCompletion completionHandler) { |
| 59 NOTREACHED() << "JavaScript cannot be evaluated on native interstitials."; | 63 NOTREACHED() << "JavaScript cannot be evaluated on native interstitials."; |
| 60 } | 64 } |
| 61 | 65 |
| 62 } // namespace web | 66 } // namespace web |
| OLD | NEW |