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

Side by Side 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 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 "chrome/browser/profiles/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "content/public/browser/browser_thread.h" 47 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/host_zoom_map.h" 48 #include "content/public/browser/host_zoom_map.h"
49 #include "content/public/browser/notification_service.h" 49 #include "content/public/browser/notification_service.h"
50 #include "content/public/browser/notification_types.h" 50 #include "content/public/browser/notification_types.h"
51 #include "content/public/browser/render_process_host.h" 51 #include "content/public/browser/render_process_host.h"
52 #include "content/public/browser/web_contents.h" 52 #include "content/public/browser/web_contents.h"
53 #include "net/base/transport_security_state.h" 53 #include "net/base/transport_security_state.h"
54 #include "net/http/http_server_properties.h" 54 #include "net/http/http_server_properties.h"
55 #include "webkit/database/database_tracker.h" 55 #include "webkit/database/database_tracker.h"
56 56
57 #if defined(OS_ANDROID)
58 #include "chrome/browser/prefs/scoped_user_pref_update.h"
59 #endif
60
57 #if defined(OS_CHROMEOS) 61 #if defined(OS_CHROMEOS)
58 #include "chrome/browser/chromeos/preferences.h" 62 #include "chrome/browser/chromeos/preferences.h"
59 #include "chrome/browser/chromeos/proxy_config_service_impl.h" 63 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
60 #endif 64 #endif
61 65
62 using content::BrowserThread; 66 using content::BrowserThread;
63 using content::DownloadManagerDelegate; 67 using content::DownloadManagerDelegate;
64 using content::HostZoomMap; 68 using content::HostZoomMap;
65 69
66 namespace { 70 namespace {
(...skipping 20 matching lines...) Expand all
87 } 91 }
88 92
89 void OffTheRecordProfileImpl::Init() { 93 void OffTheRecordProfileImpl::Init() {
90 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); 94 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false);
91 95
92 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); 96 extensions::ExtensionSystem::Get(this)->InitForOTRProfile();
93 97
94 DCHECK_NE(IncognitoModePrefs::DISABLED, 98 DCHECK_NE(IncognitoModePrefs::DISABLED,
95 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); 99 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()));
96 100
101 #if defined(OS_ANDROID)
102 UseSystemProxy();
103 #endif // defined(OS_ANDROID)
104
97 // TODO(oshima): Remove the need to eagerly initialize the request context 105 // TODO(oshima): Remove the need to eagerly initialize the request context
98 // getter. chromeos::OnlineAttempt is illegally trying to access this 106 // getter. chromeos::OnlineAttempt is illegally trying to access this
99 // Profile member from a thread other than the UI thread, so we need to 107 // Profile member from a thread other than the UI thread, so we need to
100 // prevent a race. 108 // prevent a race.
101 #if defined(OS_CHROMEOS) 109 #if defined(OS_CHROMEOS)
102 GetRequestContext(); 110 GetRequestContext();
103 #endif // defined(OS_CHROMEOS) 111 #endif // defined(OS_CHROMEOS)
104 112
105 InitHostZoomMap(); 113 InitHostZoomMap();
106 114
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); 158 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
151 HostZoomMap* parent_host_zoom_map = 159 HostZoomMap* parent_host_zoom_map =
152 HostZoomMap::GetForBrowserContext(profile_); 160 HostZoomMap::GetForBrowserContext(profile_);
153 host_zoom_map->CopyFrom(parent_host_zoom_map); 161 host_zoom_map->CopyFrom(parent_host_zoom_map);
154 // Observe parent's HZM change for propagating change of parent's 162 // Observe parent's HZM change for propagating change of parent's
155 // change to this HZM. 163 // change to this HZM.
156 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, 164 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
157 content::Source<HostZoomMap>(parent_host_zoom_map)); 165 content::Source<HostZoomMap>(parent_host_zoom_map));
158 } 166 }
159 167
168 #if defined(OS_ANDROID)
169 void OffTheRecordProfileImpl::UseSystemProxy() {
170 // Force the use of the system-assigned proxy when off the record.
171 const char kProxyMode[] = "mode";
172 const char kProxyServer[] = "server";
173 const char kProxyBypassList[] = "bypass_list";
174 const char kProxyPacUrl[] = "pac_url";
175 DictionaryPrefUpdate update(prefs_, prefs::kProxy);
176 DictionaryValue* dict = update.Get();
177 dict->SetString(kProxyMode, ProxyModeToString(ProxyPrefs::MODE_SYSTEM));
178 dict->SetString(kProxyPacUrl, "");
179 dict->SetString(kProxyServer, "");
180 dict->SetString(kProxyBypassList, "");
181 }
182 #endif // defined(OS_ANDROID)
183
160 std::string OffTheRecordProfileImpl::GetProfileName() { 184 std::string OffTheRecordProfileImpl::GetProfileName() {
161 // Incognito profile should not return the profile name. 185 // Incognito profile should not return the profile name.
162 return std::string(); 186 return std::string();
163 } 187 }
164 188
165 FilePath OffTheRecordProfileImpl::GetPath() { 189 FilePath OffTheRecordProfileImpl::GetPath() {
166 return profile_->GetPath(); 190 return profile_->GetPath();
167 } 191 }
168 192
169 bool OffTheRecordProfileImpl::IsOffTheRecord() const { 193 bool OffTheRecordProfileImpl::IsOffTheRecord() const {
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (!profile) 500 if (!profile)
477 profile = new OffTheRecordProfileImpl(this); 501 profile = new OffTheRecordProfileImpl(this);
478 profile->Init(); 502 profile->Init();
479 return profile; 503 return profile;
480 } 504 }
481 505
482 base::Callback<ChromeURLDataManagerBackend*(void)> 506 base::Callback<ChromeURLDataManagerBackend*(void)>
483 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { 507 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const {
484 return io_data_.GetChromeURLDataManagerBackendGetter(); 508 return io_data_.GetChromeURLDataManagerBackendGetter();
485 } 509 }
OLDNEW
« 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