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

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

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

Powered by Google App Engine
This is Rietveld 408576698