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

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 10985083: Upstreaming SpdyProxy-related switches, OTR logic, and histograms (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Alphabetized includes Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/off_the_record_profile_impl.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index a05c6dcb20563366a7c950f9963cb91ce159d162..9c93916a14c900ae5821cac3fda58f6aab884e01 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -54,6 +54,10 @@
#include "net/http/http_server_properties.h"
#include "webkit/database/database_tracker.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
+#endif
+
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/preferences.h"
#include "chrome/browser/chromeos/proxy_config_service_impl.h"
@@ -94,6 +98,10 @@ void OffTheRecordProfileImpl::Init() {
DCHECK_NE(IncognitoModePrefs::DISABLED,
IncognitoModePrefs::GetAvailability(profile_->GetPrefs()));
+#if defined(OS_ANDROID)
+ UseSystemProxy();
+#endif // defined(OS_ANDROID)
+
// TODO(oshima): Remove the need to eagerly initialize the request context
// getter. chromeos::OnlineAttempt is illegally trying to access this
// Profile member from a thread other than the UI thread, so we need to
@@ -157,6 +165,22 @@ void OffTheRecordProfileImpl::InitHostZoomMap() {
content::Source<HostZoomMap>(parent_host_zoom_map));
}
+#if defined(OS_ANDROID)
+void OffTheRecordProfileImpl::UseSystemProxy() {
+ // Force the use of the system-assigned proxy when off the record.
+ const char kProxyMode[] = "mode";
+ const char kProxyServer[] = "server";
+ const char kProxyBypassList[] = "bypass_list";
+ const char kProxyPacUrl[] = "pac_url";
+ DictionaryPrefUpdate update(prefs_, prefs::kProxy);
+ DictionaryValue* dict = update.Get();
+ dict->SetString(kProxyMode, ProxyModeToString(ProxyPrefs::MODE_SYSTEM));
+ dict->SetString(kProxyPacUrl, "");
+ dict->SetString(kProxyServer, "");
+ dict->SetString(kProxyBypassList, "");
+}
+#endif // defined(OS_ANDROID)
+
std::string OffTheRecordProfileImpl::GetProfileName() {
// Incognito profile should not return the profile name.
return std::string();
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698