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(); |