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

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: Rebase. 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
« no previous file with comments | « ios/web_view/shell/shell_app_delegate.m ('k') | no next file » | 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/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 // Gives a restoration identifier so that state restoration works. 154 // Gives a restoration identifier so that state restoration works.
150 _webView.restorationIdentifier = @"webView"; 155 _webView.restorationIdentifier = @"webView";
151 _webView.navigationDelegate = self; 156 _webView.navigationDelegate = self;
152 _webView.UIDelegate = self; 157 _webView.UIDelegate = self;
153 _translateController = [[TranslateController alloc] init]; 158 _translateController = [[TranslateController alloc] init];
154 _webView.translationDelegate = _translateController; 159 _webView.translationDelegate = _translateController;
155 160
156 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | 161 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
157 UIViewAutoresizingFlexibleHeight]; 162 UIViewAutoresizingFlexibleHeight];
158 [_containerView addSubview:_webView]; 163 [_containerView addSubview:_webView];
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // TODO(crbug.com/679895): Add some visual indication that the page load has 378 // TODO(crbug.com/679895): Add some visual indication that the page load has
374 // finished. 379 // finished.
375 [self updateToolbar]; 380 [self updateToolbar];
376 } 381 }
377 382
378 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { 383 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView {
379 NSLog(@"webViewWebContentProcessDidTerminate"); 384 NSLog(@"webViewWebContentProcessDidTerminate");
380 } 385 }
381 386
382 @end 387 @end
OLDNEW
« no previous file with comments | « ios/web_view/shell/shell_app_delegate.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698