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

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: most unittests pass Created 7 years, 4 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
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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/download/download_service.h" 21 #include "chrome/browser/download/download_service.h"
22 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
23 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 23 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
24 #include "chrome/browser/extensions/extension_info_map.h" 24 #include "chrome/browser/extensions/extension_info_map.h"
25 #include "chrome/browser/extensions/extension_service.h" 25 #include "chrome/browser/extensions/extension_service.h"
26 #include "chrome/browser/extensions/extension_special_storage_policy.h" 26 #include "chrome/browser/extensions/extension_special_storage_policy.h"
27 #include "chrome/browser/extensions/extension_system.h" 27 #include "chrome/browser/extensions/extension_system.h"
28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto ry.h" 29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto ry.h"
30 #include "chrome/browser/io_thread.h" 30 #include "chrome/browser/io_thread.h"
31 #include "chrome/browser/net/cookie_store_util.h"
31 #include "chrome/browser/net/pref_proxy_config_tracker.h" 32 #include "chrome/browser/net/pref_proxy_config_tracker.h"
32 #include "chrome/browser/net/proxy_service_factory.h" 33 #include "chrome/browser/net/proxy_service_factory.h"
33 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 34 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
34 #include "chrome/browser/plugins/plugin_prefs.h" 35 #include "chrome/browser/plugins/plugin_prefs.h"
35 #include "chrome/browser/prefs/incognito_mode_prefs.h" 36 #include "chrome/browser/prefs/incognito_mode_prefs.h"
36 #include "chrome/browser/prefs/pref_service_syncable.h" 37 #include "chrome/browser/prefs/pref_service_syncable.h"
37 #include "chrome/browser/themes/theme_service.h" 38 #include "chrome/browser/themes/theme_service.h"
38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 39 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
39 #include "chrome/common/chrome_constants.h" 40 #include "chrome/common/chrome_constants.h"
40 #include "chrome/common/chrome_paths.h" 41 #include "chrome/common/chrome_paths.h"
41 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/extensions/extension.h" 43 #include "chrome/common/extensions/extension.h"
43 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
44 #include "chrome/common/render_messages.h" 45 #include "chrome/common/render_messages.h"
45 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 46 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
46 #include "components/user_prefs/user_prefs.h" 47 #include "components/user_prefs/user_prefs.h"
47 #include "content/public/browser/browser_thread.h" 48 #include "content/public/browser/browser_thread.h"
49 #include "content/public/browser/cookie_store_factory.h"
48 #include "content/public/browser/host_zoom_map.h" 50 #include "content/public/browser/host_zoom_map.h"
49 #include "content/public/browser/render_process_host.h" 51 #include "content/public/browser/render_process_host.h"
50 #include "content/public/browser/storage_partition.h" 52 #include "content/public/browser/storage_partition.h"
51 #include "content/public/browser/url_data_source.h" 53 #include "content/public/browser/url_data_source.h"
52 #include "content/public/browser/web_contents.h" 54 #include "content/public/browser/web_contents.h"
53 #include "net/http/http_server_properties.h" 55 #include "net/http/http_server_properties.h"
54 #include "net/http/transport_security_state.h" 56 #include "net/http/transport_security_state.h"
55 #include "webkit/browser/database/database_tracker.h" 57 #include "webkit/browser/database/database_tracker.h"
56 58
57 #if defined(OS_ANDROID) || defined(OS_IOS) 59 #if defined(OS_ANDROID) || defined(OS_IOS)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 190
189 std::string OffTheRecordProfileImpl::GetProfileName() { 191 std::string OffTheRecordProfileImpl::GetProfileName() {
190 // Incognito profile should not return the profile name. 192 // Incognito profile should not return the profile name.
191 return std::string(); 193 return std::string();
192 } 194 }
193 195
194 base::FilePath OffTheRecordProfileImpl::GetPath() const { 196 base::FilePath OffTheRecordProfileImpl::GetPath() const {
195 return profile_->GetPath(); 197 return profile_->GetPath();
196 } 198 }
197 199
200 content::CookieStoreConfig OffTheRecordProfileImpl::GetCookieStoreConfig() {
201 if (!cookie_delegate_) {
202 cookie_delegate_ = chrome_browser_net::CreateCookieDelegate(this);
203 }
204
205 return content::CookieStoreConfig::InMemoryWithOptions(
206 GetExtensionSpecialStoragePolicy(), cookie_delegate_);
207 }
208
198 scoped_refptr<base::SequencedTaskRunner> 209 scoped_refptr<base::SequencedTaskRunner>
199 OffTheRecordProfileImpl::GetIOTaskRunner() { 210 OffTheRecordProfileImpl::GetIOTaskRunner() {
200 return profile_->GetIOTaskRunner(); 211 return profile_->GetIOTaskRunner();
201 } 212 }
202 213
203 bool OffTheRecordProfileImpl::IsOffTheRecord() const { 214 bool OffTheRecordProfileImpl::IsOffTheRecord() const {
204 return true; 215 return true;
205 } 216 }
206 217
207 Profile* OffTheRecordProfileImpl::GetOffTheRecordProfile() { 218 Profile* OffTheRecordProfileImpl::GetOffTheRecordProfile() {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 void OffTheRecordProfileImpl::RequestMIDISysExPermission( 295 void OffTheRecordProfileImpl::RequestMIDISysExPermission(
285 int render_process_id, 296 int render_process_id,
286 int render_view_id, 297 int render_view_id,
287 const GURL& requesting_frame, 298 const GURL& requesting_frame,
288 const MIDISysExPermissionCallback& callback) { 299 const MIDISysExPermissionCallback& callback) {
289 // TODO(toyoshim): Implement. http://crbug.com/257618 . 300 // TODO(toyoshim): Implement. http://crbug.com/257618 .
290 callback.Run(false); 301 callback.Run(false);
291 } 302 }
292 303
293 net::URLRequestContextGetter* 304 net::URLRequestContextGetter*
294 OffTheRecordProfileImpl::GetRequestContextForExtensions() {
295 return io_data_.GetExtensionsRequestContextGetter().get();
296 }
297
298 net::URLRequestContextGetter*
299 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( 305 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition(
300 const base::FilePath& partition_path, 306 const base::FilePath& partition_path,
301 bool in_memory, 307 bool in_memory,
302 content::ProtocolHandlerMap* protocol_handlers) { 308 content::ProtocolHandlerMap* protocol_handlers) {
303 return io_data_.CreateIsolatedAppRequestContextGetter( 309 return io_data_.CreateIsolatedAppRequestContextGetter(
304 partition_path, in_memory, protocol_handlers).get(); 310 partition_path, in_memory, protocol_handlers).get();
305 } 311 }
306 312
307 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { 313 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() {
308 return io_data_.GetResourceContext(); 314 return io_data_.GetResourceContext();
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 #if defined(OS_CHROMEOS) 485 #if defined(OS_CHROMEOS)
480 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 486 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
481 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 487 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
482 g_browser_process->local_state()); 488 g_browser_process->local_state());
483 } 489 }
484 #endif // defined(OS_CHROMEOS) 490 #endif // defined(OS_CHROMEOS)
485 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 491 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
486 GetPrefs(), g_browser_process->local_state()); 492 GetPrefs(), g_browser_process->local_state());
487 } 493 }
488 494
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698