| 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/html_web_interstitial_impl.h" | 5 #import "ios/web/interstitials/html_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 "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 #pragma mark - | 71 #pragma mark - |
| 72 | 72 |
| 73 namespace web { | 73 namespace web { |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 WebInterstitial* WebInterstitial::CreateHtmlInterstitial( | 76 WebInterstitial* WebInterstitial::CreateHtmlInterstitial( |
| 77 WebState* web_state, | 77 WebState* web_state, |
| 78 bool new_navigation, | 78 bool new_navigation, |
| 79 const GURL& url, | 79 const GURL& url, |
| 80 scoped_ptr<HtmlWebInterstitialDelegate> delegate) { | 80 std::unique_ptr<HtmlWebInterstitialDelegate> delegate) { |
| 81 WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state); | 81 WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state); |
| 82 return new HtmlWebInterstitialImpl(web_state_impl, new_navigation, url, | 82 return new HtmlWebInterstitialImpl(web_state_impl, new_navigation, url, |
| 83 std::move(delegate)); | 83 std::move(delegate)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 HtmlWebInterstitialImpl::HtmlWebInterstitialImpl( | 86 HtmlWebInterstitialImpl::HtmlWebInterstitialImpl( |
| 87 WebStateImpl* web_state, | 87 WebStateImpl* web_state, |
| 88 bool new_navigation, | 88 bool new_navigation, |
| 89 const GURL& url, | 89 const GURL& url, |
| 90 scoped_ptr<HtmlWebInterstitialDelegate> delegate) | 90 std::unique_ptr<HtmlWebInterstitialDelegate> delegate) |
| 91 : WebInterstitialImpl(web_state, new_navigation, url), | 91 : WebInterstitialImpl(web_state, new_navigation, url), |
| 92 delegate_(std::move(delegate)) { | 92 delegate_(std::move(delegate)) { |
| 93 DCHECK(delegate_); | 93 DCHECK(delegate_); |
| 94 } | 94 } |
| 95 | 95 |
| 96 HtmlWebInterstitialImpl::~HtmlWebInterstitialImpl() { | 96 HtmlWebInterstitialImpl::~HtmlWebInterstitialImpl() { |
| 97 } | 97 } |
| 98 | 98 |
| 99 void HtmlWebInterstitialImpl::CommandReceivedFromWebView(NSString* command) { | 99 void HtmlWebInterstitialImpl::CommandReceivedFromWebView(NSString* command) { |
| 100 delegate_->CommandReceived(base::SysNSStringToUTF8(command)); | 100 delegate_->CommandReceived(base::SysNSStringToUTF8(command)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 125 return delegate_.get(); | 125 return delegate_.get(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void HtmlWebInterstitialImpl::EvaluateJavaScript( | 128 void HtmlWebInterstitialImpl::EvaluateJavaScript( |
| 129 NSString* script, | 129 NSString* script, |
| 130 JavaScriptCompletion completionHandler) { | 130 JavaScriptCompletion completionHandler) { |
| 131 web::EvaluateJavaScript(web_view_, script, completionHandler); | 131 web::EvaluateJavaScript(web_view_, script, completionHandler); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace web | 134 } // namespace web |
| OLD | NEW |