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

Side by Side Diff: android_webview/browser/aw_browser_context.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 (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/aw_browser_context.h" 5 #include "android_webview/browser/aw_browser_context.h"
6 6
7 #include "android_webview/browser/aw_form_database_service.h" 7 #include "android_webview/browser/aw_form_database_service.h"
8 #include "android_webview/browser/aw_pref_store.h" 8 #include "android_webview/browser/aw_pref_store.h"
9 #include "android_webview/browser/aw_quota_manager_bridge.h" 9 #include "android_webview/browser/aw_quota_manager_bridge.h"
10 #include "android_webview/browser/aw_resource_context.h" 10 #include "android_webview/browser/aw_resource_context.h"
11 #include "android_webview/browser/jni_dependency_factory.h" 11 #include "android_webview/browser/jni_dependency_factory.h"
12 #include "android_webview/browser/net/aw_url_request_context_getter.h" 12 #include "android_webview/browser/net/aw_url_request_context_getter.h"
13 #include "android_webview/browser/net/init_native_callback.h" 13 #include "android_webview/browser/net/init_native_callback.h"
14 #include "base/prefs/pref_registry_simple.h" 14 #include "base/prefs/pref_registry_simple.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/prefs/pref_service_factory.h" 16 #include "base/prefs/pref_service_factory.h"
17 #include "components/autofill/core/common/autofill_pref_names.h" 17 #include "components/autofill/core/common/autofill_pref_names.h"
18 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se rvice.h" 18 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se rvice.h"
19 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
19 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" 20 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h"
20 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 21 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
21 #include "components/user_prefs/user_prefs.h" 22 #include "components/user_prefs/user_prefs.h"
22 #include "components/visitedlink/browser/visitedlink_master.h" 23 #include "components/visitedlink/browser/visitedlink_master.h"
23 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/storage_partition.h" 25 #include "content/public/browser/storage_partition.h"
25 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
26 #include "net/cookies/cookie_store.h" 27 #include "net/cookies/cookie_store.h"
27 28
28 using base::FilePath; 29 using base::FilePath;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return; 88 return;
88 DataReductionProxySettings* proxy_settings = 89 DataReductionProxySettings* proxy_settings =
89 context->GetDataReductionProxySettings(); 90 context->GetDataReductionProxySettings();
90 if (proxy_settings == NULL) 91 if (proxy_settings == NULL)
91 return; 92 return;
92 proxy_settings->SetDataReductionProxyEnabled(data_reduction_proxy_enabled_); 93 proxy_settings->SetDataReductionProxyEnabled(data_reduction_proxy_enabled_);
93 } 94 }
94 95
95 void AwBrowserContext::PreMainMessageLoopRun() { 96 void AwBrowserContext::PreMainMessageLoopRun() {
96 cookie_store_ = CreateCookieStore(this); 97 cookie_store_ = CreateCookieStore(this);
97 DataReductionProxySettings::SetAllowed(true);
98 DataReductionProxySettings::SetPromoAllowed(false);
99 data_reduction_proxy_settings_.reset( 98 data_reduction_proxy_settings_.reset(
100 new DataReductionProxySettings()); 99 new DataReductionProxySettings(
101 data_reduction_proxy_settings_->set_fallback_allowed(false); 100 new data_reduction_proxy::DataReductionProxyParams(
101 true, false, false, false)));
sgurun-gerrit only 2014/05/20 23:55:21 nit: I think this large list of booleans makes it
102 102
103 url_request_context_getter_ = 103 url_request_context_getter_ =
104 new AwURLRequestContextGetter(GetPath(), cookie_store_.get()); 104 new AwURLRequestContextGetter(GetPath(), cookie_store_.get());
105 105
106 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> 106 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
107 configurator(new data_reduction_proxy::DataReductionProxyConfigTracker( 107 configurator(new data_reduction_proxy::DataReductionProxyConfigTracker(
108 url_request_context_getter_->proxy_config_service(), 108 url_request_context_getter_->proxy_config_service(),
109 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 109 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
110 data_reduction_proxy_settings_->SetProxyConfigurator(configurator.Pass()); 110 data_reduction_proxy_settings_->SetProxyConfigurator(configurator.Pass());
111 111
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 void AwBrowserContext::RebuildTable( 298 void AwBrowserContext::RebuildTable(
299 const scoped_refptr<URLEnumerator>& enumerator) { 299 const scoped_refptr<URLEnumerator>& enumerator) {
300 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 300 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
301 // can change in the lifetime of this WebView and may not yet be set here. 301 // can change in the lifetime of this WebView and may not yet be set here.
302 // Therefore this initialization path is not used. 302 // Therefore this initialization path is not used.
303 enumerator->OnComplete(true); 303 enumerator->OnComplete(true);
304 } 304 }
305 305
306 } // namespace android_webview 306 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698