OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/background_contents_service_factory.h" | 17 #include "chrome/browser/background_contents_service_factory.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
20 #include "chrome/browser/download/download_manager.h" | 20 #include "chrome/browser/download/download_manager.h" |
21 #include "chrome/browser/extensions/extension_message_service.h" | 21 #include "chrome/browser/extensions/extension_message_service.h" |
22 #include "chrome/browser/extensions/extension_pref_store.h" | 22 #include "chrome/browser/extensions/extension_pref_store.h" |
23 #include "chrome/browser/extensions/extension_process_manager.h" | 23 #include "chrome/browser/extensions/extension_process_manager.h" |
| 24 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 25 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
25 #include "chrome/browser/net/pref_proxy_config_service.h" | 26 #include "chrome/browser/net/pref_proxy_config_service.h" |
26 #include "chrome/browser/prefs/pref_service.h" | 27 #include "chrome/browser/prefs/pref_service.h" |
27 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 28 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
28 #include "chrome/browser/profiles/profile_dependency_manager.h" | 29 #include "chrome/browser/profiles/profile_dependency_manager.h" |
29 #include "chrome/browser/ssl/ssl_host_state.h" | 30 #include "chrome/browser/ssl/ssl_host_state.h" |
30 #include "chrome/browser/sync/profile_sync_service.h" | 31 #include "chrome/browser/sync/profile_sync_service.h" |
31 #include "chrome/browser/themes/theme_service.h" | 32 #include "chrome/browser/themes/theme_service.h" |
32 #include "chrome/browser/transport_security_persister.h" | 33 #include "chrome/browser/transport_security_persister.h" |
33 #include "chrome/browser/ui/browser_list.h" | 34 #include "chrome/browser/ui/browser_list.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 file_system_context_ = CreateFileSystemContext( | 400 file_system_context_ = CreateFileSystemContext( |
400 GetPath(), IsOffTheRecord(), GetExtensionSpecialStoragePolicy()); | 401 GetPath(), IsOffTheRecord(), GetExtensionSpecialStoragePolicy()); |
401 DCHECK(file_system_context_.get()); | 402 DCHECK(file_system_context_.get()); |
402 return file_system_context_.get(); | 403 return file_system_context_.get(); |
403 } | 404 } |
404 | 405 |
405 virtual net::URLRequestContextGetter* GetRequestContext() { | 406 virtual net::URLRequestContextGetter* GetRequestContext() { |
406 return io_data_.GetMainRequestContextGetter(); | 407 return io_data_.GetMainRequestContextGetter(); |
407 } | 408 } |
408 | 409 |
409 virtual net::URLRequestContextGetter* GetRequestContextForPossibleApp( | 410 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
410 const Extension* installed_app) { | 411 int renderer_child_id) { |
411 if (CommandLine::ForCurrentProcess()->HasSwitch( | 412 if (CommandLine::ForCurrentProcess()->HasSwitch( |
412 switches::kEnableExperimentalAppManifests) && | 413 switches::kEnableExperimentalAppManifests)) { |
413 installed_app != NULL && | 414 const Extension* installed_app = GetExtensionService()-> |
414 installed_app->is_storage_isolated()) | 415 GetInstalledAppForRenderer(renderer_child_id); |
415 return GetRequestContextForIsolatedApp(installed_app->id()); | 416 if (installed_app != NULL && installed_app->is_storage_isolated()) |
| 417 return GetRequestContextForIsolatedApp(installed_app->id()); |
| 418 } |
416 | 419 |
417 return GetRequestContext(); | 420 return GetRequestContext(); |
418 } | 421 } |
419 | 422 |
420 virtual net::URLRequestContextGetter* GetRequestContextForMedia() { | 423 virtual net::URLRequestContextGetter* GetRequestContextForMedia() { |
421 // In OTR mode, media request context is the same as the original one. | 424 // In OTR mode, media request context is the same as the original one. |
422 return io_data_.GetMainRequestContextGetter(); | 425 return io_data_.GetMainRequestContextGetter(); |
423 } | 426 } |
424 | 427 |
425 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() { | 428 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() { |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 }; | 767 }; |
765 #endif | 768 #endif |
766 | 769 |
767 Profile* Profile::CreateOffTheRecordProfile() { | 770 Profile* Profile::CreateOffTheRecordProfile() { |
768 #if defined(OS_CHROMEOS) | 771 #if defined(OS_CHROMEOS) |
769 if (Profile::IsGuestSession()) | 772 if (Profile::IsGuestSession()) |
770 return new GuestSessionProfile(this); | 773 return new GuestSessionProfile(this); |
771 #endif | 774 #endif |
772 return new OffTheRecordProfileImpl(this); | 775 return new OffTheRecordProfileImpl(this); |
773 } | 776 } |
OLD | NEW |