Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: ios/web_view/internal/cwv_web_view.mm

Issue 2760143002: Update ios/web_view/shell UIDelegate implementation. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ios/web_view/shell/shell_view_controller.m » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ios/web_view/shell/shell_view_controller.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698