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

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: Remove cwv.h import from Framework header. 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 [stop setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 126 [stop setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin];
127 [stop addTarget:self 127 [stop addTarget:self
128 action:@selector(stopLoading) 128 action:@selector(stopLoading)
129 forControlEvents:UIControlEventTouchUpInside]; 129 forControlEvents:UIControlEventTouchUpInside];
130 130
131 [_toolbar addSubview:back]; 131 [_toolbar addSubview:back];
132 [_toolbar addSubview:forward]; 132 [_toolbar addSubview:forward];
133 [_toolbar addSubview:stop]; 133 [_toolbar addSubview:stop];
134 [_toolbar addSubview:_field]; 134 [_toolbar addSubview:_field];
135 135
136 self.webView = [CWV webViewWithFrame:[_containerView bounds]]; 136 [CWVWebView setUserAgentProduct:@"Dummy/1.0"];
137
138 CWVWebViewConfiguration* configuration =
139 [CWVWebViewConfiguration defaultConfiguration];
140 self.webView = [[CWVWebView alloc] initWithFrame:[_containerView bounds]
141 configuration:configuration];
137 _webView.navigationDelegate = self; 142 _webView.navigationDelegate = self;
138 _webView.UIDelegate = self; 143 _webView.UIDelegate = self;
139 _translateController = [[TranslateController alloc] init]; 144 _translateController = [[TranslateController alloc] init];
140 _webView.translationDelegate = _translateController; 145 _webView.translationDelegate = _translateController;
141 146
142 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | 147 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
143 UIViewAutoresizingFlexibleHeight]; 148 UIViewAutoresizingFlexibleHeight];
144 [_containerView addSubview:_webView]; 149 [_containerView addSubview:_webView];
145 150
146 NSURLRequest* request = [NSURLRequest 151 NSURLRequest* request = [NSURLRequest
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 // TODO(crbug.com/679895): Add some visual indication that the page load has 348 // TODO(crbug.com/679895): Add some visual indication that the page load has
344 // finished. 349 // finished.
345 [self updateToolbar]; 350 [self updateToolbar];
346 } 351 }
347 352
348 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { 353 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView {
349 NSLog(@"webViewWebContentProcessDidTerminate"); 354 NSLog(@"webViewWebContentProcessDidTerminate");
350 } 355 }
351 356
352 @end 357 @end
OLDNEW
« ios/web_view/public/cwv_web_view.h ('K') | « 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