| 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" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/prefs/pref_service.h" | 28 #include "chrome/browser/prefs/pref_service.h" |
| 29 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 29 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
| 30 #include "chrome/browser/ssl/ssl_host_state.h" | 30 #include "chrome/browser/ssl/ssl_host_state.h" |
| 31 #include "chrome/browser/sync/profile_sync_service.h" | 31 #include "chrome/browser/sync/profile_sync_service.h" |
| 32 #include "chrome/browser/themes/browser_theme_provider.h" | 32 #include "chrome/browser/themes/browser_theme_provider.h" |
| 33 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 33 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 34 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 34 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 35 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
| 36 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
| 37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/extensions/extension.h" |
| 38 #include "chrome/common/json_pref_store.h" | 39 #include "chrome/common/json_pref_store.h" |
| 39 #include "chrome/common/notification_service.h" | 40 #include "chrome/common/notification_service.h" |
| 40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/render_messages.h" | 42 #include "chrome/common/render_messages.h" |
| 42 #include "content/browser/appcache/chrome_appcache_service.h" | 43 #include "content/browser/appcache/chrome_appcache_service.h" |
| 43 #include "content/browser/browser_thread.h" | 44 #include "content/browser/browser_thread.h" |
| 44 #include "content/browser/chrome_blob_storage_context.h" | 45 #include "content/browser/chrome_blob_storage_context.h" |
| 45 #include "content/browser/file_system/browser_file_system_helper.h" | 46 #include "content/browser/file_system/browser_file_system_helper.h" |
| 46 #include "content/browser/host_zoom_map.h" | 47 #include "content/browser/host_zoom_map.h" |
| 47 #include "content/browser/in_process_webkit/webkit_context.h" | 48 #include "content/browser/in_process_webkit/webkit_context.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 413 } |
| 413 | 414 |
| 414 virtual BrowserThemeProvider* GetThemeProvider() { | 415 virtual BrowserThemeProvider* GetThemeProvider() { |
| 415 return profile_->GetThemeProvider(); | 416 return profile_->GetThemeProvider(); |
| 416 } | 417 } |
| 417 | 418 |
| 418 virtual URLRequestContextGetter* GetRequestContext() { | 419 virtual URLRequestContextGetter* GetRequestContext() { |
| 419 return io_data_.GetMainRequestContextGetter(); | 420 return io_data_.GetMainRequestContextGetter(); |
| 420 } | 421 } |
| 421 | 422 |
| 423 virtual URLRequestContextGetter* GetRequestContextForPossibleApp( |
| 424 const Extension* installed_app) { |
| 425 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 426 switches::kEnableExperimentalAppManifests) && |
| 427 installed_app != NULL && |
| 428 installed_app->is_storage_isolated()) |
| 429 return GetRequestContextForIsolatedApp(installed_app); |
| 430 |
| 431 return GetRequestContext(); |
| 432 } |
| 433 |
| 422 virtual URLRequestContextGetter* GetRequestContextForMedia() { | 434 virtual URLRequestContextGetter* GetRequestContextForMedia() { |
| 423 // In OTR mode, media request context is the same as the original one. | 435 // In OTR mode, media request context is the same as the original one. |
| 424 return io_data_.GetMainRequestContextGetter(); | 436 return io_data_.GetMainRequestContextGetter(); |
| 425 } | 437 } |
| 426 | 438 |
| 427 URLRequestContextGetter* GetRequestContextForExtensions() { | 439 URLRequestContextGetter* GetRequestContextForExtensions() { |
| 428 return io_data_.GetExtensionsRequestContextGetter(); | 440 return io_data_.GetExtensionsRequestContextGetter(); |
| 429 } | 441 } |
| 430 | 442 |
| 443 URLRequestContextGetter* GetRequestContextForIsolatedApp( |
| 444 const Extension* installed_app) { |
| 445 return io_data_.GetIsolatedAppRequestContextGetter(installed_app); |
| 446 } |
| 447 |
| 431 virtual net::SSLConfigService* GetSSLConfigService() { | 448 virtual net::SSLConfigService* GetSSLConfigService() { |
| 432 return profile_->GetSSLConfigService(); | 449 return profile_->GetSSLConfigService(); |
| 433 } | 450 } |
| 434 | 451 |
| 435 virtual HostContentSettingsMap* GetHostContentSettingsMap() { | 452 virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
| 436 // Retrieve the host content settings map of the parent profile in order to | 453 // Retrieve the host content settings map of the parent profile in order to |
| 437 // ensure the preferences have been migrated. | 454 // ensure the preferences have been migrated. |
| 438 profile_->GetHostContentSettingsMap(); | 455 profile_->GetHostContentSettingsMap(); |
| 439 if (!host_content_settings_map_.get()) | 456 if (!host_content_settings_map_.get()) |
| 440 host_content_settings_map_ = new HostContentSettingsMap(this); | 457 host_content_settings_map_ = new HostContentSettingsMap(this); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 }; | 786 }; |
| 770 #endif | 787 #endif |
| 771 | 788 |
| 772 Profile* Profile::CreateOffTheRecordProfile() { | 789 Profile* Profile::CreateOffTheRecordProfile() { |
| 773 #if defined(OS_CHROMEOS) | 790 #if defined(OS_CHROMEOS) |
| 774 if (Profile::IsGuestSession()) | 791 if (Profile::IsGuestSession()) |
| 775 return new GuestSessionProfile(this); | 792 return new GuestSessionProfile(this); |
| 776 #endif | 793 #endif |
| 777 return new OffTheRecordProfileImpl(this); | 794 return new OffTheRecordProfileImpl(this); |
| 778 } | 795 } |
| OLD | NEW |