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

Side by Side Diff: ios/web_view/shell/shell_view_controller.m

Issue 2791403005: Remove CWV class and move setting User Agent to CWVWebViewConfiguration. (Closed)
Patch Set: Respond to comments. Created 3 years, 8 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
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/shell/shell_view_controller.h" 5 #import "ios/web_view/shell/shell_view_controller.h"
6 6
7 #import <ChromeWebView/ChromeWebView.h> 7 #import <ChromeWebView/ChromeWebView.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 9
10 #import "ios/web_view/shell/translate_controller.h" 10 #import "ios/web_view/shell/translate_controller.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 [menu addTarget:self 138 [menu addTarget:self
139 action:@selector(showMenu) 139 action:@selector(showMenu)
140 forControlEvents:UIControlEventTouchUpInside]; 140 forControlEvents:UIControlEventTouchUpInside];
141 141
142 [_toolbar addSubview:back]; 142 [_toolbar addSubview:back];
143 [_toolbar addSubview:forward]; 143 [_toolbar addSubview:forward];
144 [_toolbar addSubview:stop]; 144 [_toolbar addSubview:stop];
145 [_toolbar addSubview:menu]; 145 [_toolbar addSubview:menu];
146 [_toolbar addSubview:_field]; 146 [_toolbar addSubview:_field];
147 147
148 self.webView = [CWV webViewWithFrame:[_containerView bounds]]; 148 [CWVWebView setUserAgentProduct:@"Dummy/1.0"];
149
150 CWVWebViewConfiguration* configuration =
151 [CWVWebViewConfiguration defaultConfiguration];
152 self.webView = [[CWVWebView alloc] initWithFrame:[_containerView bounds]
153 configuration:configuration];
149 _webView.navigationDelegate = self; 154 _webView.navigationDelegate = self;
150 _webView.UIDelegate = self; 155 _webView.UIDelegate = self;
151 _translateController = [[TranslateController alloc] init]; 156 _translateController = [[TranslateController alloc] init];
152 _webView.translationDelegate = _translateController; 157 _webView.translationDelegate = _translateController;
153 158
154 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | 159 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
155 UIViewAutoresizingFlexibleHeight]; 160 UIViewAutoresizingFlexibleHeight];
156 [_containerView addSubview:_webView]; 161 [_containerView addSubview:_webView];
157 162
158 NSURLRequest* request = [NSURLRequest 163 NSURLRequest* request = [NSURLRequest
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // TODO(crbug.com/679895): Add some visual indication that the page load has 376 // TODO(crbug.com/679895): Add some visual indication that the page load has
372 // finished. 377 // finished.
373 [self updateToolbar]; 378 [self updateToolbar];
374 } 379 }
375 380
376 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { 381 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView {
377 NSLog(@"webViewWebContentProcessDidTerminate"); 382 NSLog(@"webViewWebContentProcessDidTerminate");
378 } 383 }
379 384
380 @end 385 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698