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

Side by Side Diff: trunk/src/android_webview/browser/net/aw_url_request_context_getter.cc

Issue 192283002: Revert 255858 "Simplify the user agent code some more since afte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/android_webview/common/aw_content_client.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "android_webview/browser/net/aw_url_request_context_getter.h" 5 #include "android_webview/browser/net/aw_url_request_context_getter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/browser/aw_content_browser_client.h" 9 #include "android_webview/browser/aw_content_browser_client.h"
10 #include "android_webview/browser/aw_request_interceptor.h" 10 #include "android_webview/browser/aw_request_interceptor.h"
11 #include "android_webview/browser/net/aw_network_delegate.h" 11 #include "android_webview/browser/net/aw_network_delegate.h"
12 #include "android_webview/browser/net/aw_url_request_job_factory.h" 12 #include "android_webview/browser/net/aw_url_request_job_factory.h"
13 #include "android_webview/browser/net/init_native_callback.h" 13 #include "android_webview/browser/net/init_native_callback.h"
14 #include "android_webview/common/aw_content_client.h"
15 #include "android_webview/common/aw_switches.h" 14 #include "android_webview/common/aw_switches.h"
16 #include "base/command_line.h" 15 #include "base/command_line.h"
17 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
18 #include "base/threading/sequenced_worker_pool.h" 17 #include "base/threading/sequenced_worker_pool.h"
19 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/content_browser_client.h" 19 #include "content/public/browser/content_browser_client.h"
21 #include "content/public/browser/cookie_store_factory.h" 20 #include "content/public/browser/cookie_store_factory.h"
22 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
23 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
24 #include "content/public/common/url_constants.h" 23 #include "content/public/common/url_constants.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 170 }
172 171
173 AwURLRequestContextGetter::~AwURLRequestContextGetter() { 172 AwURLRequestContextGetter::~AwURLRequestContextGetter() {
174 } 173 }
175 174
176 void AwURLRequestContextGetter::InitializeURLRequestContext() { 175 void AwURLRequestContextGetter::InitializeURLRequestContext() {
177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
178 DCHECK(!url_request_context_); 177 DCHECK(!url_request_context_);
179 178
180 net::URLRequestContextBuilder builder; 179 net::URLRequestContextBuilder builder;
181 builder.set_user_agent(GetUserAgent()); 180 builder.set_user_agent(content::GetUserAgent(GURL()));
182 builder.set_network_delegate(new AwNetworkDelegate()); 181 builder.set_network_delegate(new AwNetworkDelegate());
183 #if !defined(DISABLE_FTP_SUPPORT) 182 #if !defined(DISABLE_FTP_SUPPORT)
184 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. 183 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet.
185 #endif 184 #endif
186 builder.set_proxy_config_service(proxy_config_service_.release()); 185 builder.set_proxy_config_service(proxy_config_service_.release());
187 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader( 186 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader(
188 AwContentBrowserClient::GetAcceptLangsImpl())); 187 AwContentBrowserClient::GetAcceptLangsImpl()));
189 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder); 188 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder);
190 189
191 url_request_context_.reset(builder.Build()); 190 url_request_context_.reset(builder.Build());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 AwURLRequestContextGetter::GetNetworkTaskRunner() const { 226 AwURLRequestContextGetter::GetNetworkTaskRunner() const {
228 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 227 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
229 } 228 }
230 229
231 void AwURLRequestContextGetter::SetProtocolHandlers( 230 void AwURLRequestContextGetter::SetProtocolHandlers(
232 content::ProtocolHandlerMap* protocol_handlers) { 231 content::ProtocolHandlerMap* protocol_handlers) {
233 std::swap(protocol_handlers_, *protocol_handlers); 232 std::swap(protocol_handlers_, *protocol_handlers);
234 } 233 }
235 234
236 } // namespace android_webview 235 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | trunk/src/android_webview/common/aw_content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698