| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_view/public/cwv_web_view.h" | 5 #import "ios/web_view/public/cwv_web_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 _webStateObserver = | 73 _webStateObserver = |
| 74 base::MakeUnique<web::WebStateObserverBridge>(_webState.get(), self); | 74 base::MakeUnique<web::WebStateObserverBridge>(_webState.get(), self); |
| 75 _webStateDelegate = base::MakeUnique<web::WebStateDelegateBridge>(self); | 75 _webStateDelegate = base::MakeUnique<web::WebStateDelegateBridge>(self); |
| 76 _webState->SetDelegate(_webStateDelegate.get()); | 76 _webState->SetDelegate(_webStateDelegate.get()); |
| 77 | 77 |
| 78 _webStatePolicyDecider = | 78 _webStatePolicyDecider = |
| 79 base::MakeUnique<ios_web_view::WebViewWebStatePolicyDecider>( | 79 base::MakeUnique<ios_web_view::WebViewWebStatePolicyDecider>( |
| 80 _webState.get(), self); | 80 _webState.get(), self); |
| 81 | 81 |
| 82 _javaScriptDialogPresenter = |
| 83 base::MakeUnique<ios_web_view::WebViewJavaScriptDialogPresenter>( |
| 84 self, nullptr); |
| 85 |
| 82 // Initialize Translate. | 86 // Initialize Translate. |
| 83 ios_web_view::WebViewTranslateClient::CreateForWebState(_webState.get()); | 87 ios_web_view::WebViewTranslateClient::CreateForWebState(_webState.get()); |
| 84 } | 88 } |
| 85 return self; | 89 return self; |
| 86 } | 90 } |
| 87 | 91 |
| 88 - (void)willMoveToSuperview:(UIView*)newSuperview { | 92 - (void)willMoveToSuperview:(UIView*)newSuperview { |
| 89 [super willMoveToSuperview:newSuperview]; | 93 [super willMoveToSuperview:newSuperview]; |
| 90 UIView* subview = _webState->GetView(); | 94 UIView* subview = _webState->GetView(); |
| 91 if (subview.superview == self) { | 95 if (subview.superview == self) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 [_UIDelegate webViewDidClose:self]; | 266 [_UIDelegate webViewDidClose:self]; |
| 263 } | 267 } |
| 264 } | 268 } |
| 265 | 269 |
| 266 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: | 270 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: |
| 267 (web::WebState*)webState { | 271 (web::WebState*)webState { |
| 268 return _javaScriptDialogPresenter.get(); | 272 return _javaScriptDialogPresenter.get(); |
| 269 } | 273 } |
| 270 | 274 |
| 271 @end | 275 @end |
| OLD | NEW |