| OLD | NEW | 
|---|
| 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/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 63 #include "webkit/database/database_tracker.h" | 63 #include "webkit/database/database_tracker.h" | 
| 64 #include "webkit/fileapi/file_system_context.h" | 64 #include "webkit/fileapi/file_system_context.h" | 
| 65 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 65 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 
| 66 #include "webkit/quota/quota_manager.h" | 66 #include "webkit/quota/quota_manager.h" | 
| 67 | 67 | 
| 68 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) | 
| 69 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 69 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 
| 70 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 70 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 
| 71 #endif  // defined(OS_CHROMEOS) | 71 #endif  // defined(OS_CHROMEOS) | 
| 72 | 72 | 
|  | 73 using content::BrowserContext; | 
| 73 using content::BrowserThread; | 74 using content::BrowserThread; | 
| 74 | 75 | 
| 75 namespace { | 76 namespace { | 
| 76 | 77 | 
| 77 // ---------------------------------------------------------------------------- | 78 // ---------------------------------------------------------------------------- | 
| 78 // CookieMonster::Delegate implementation | 79 // CookieMonster::Delegate implementation | 
| 79 // ---------------------------------------------------------------------------- | 80 // ---------------------------------------------------------------------------- | 
| 80 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 81 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 
| 81  public: | 82  public: | 
| 82   explicit ChromeCookieMonsterDelegate( | 83   explicit ChromeCookieMonsterDelegate( | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 188 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 189 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 
| 189   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 190   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 
| 190   PrefService* pref_service = profile->GetPrefs(); | 191   PrefService* pref_service = profile->GetPrefs(); | 
| 191 | 192 | 
| 192   scoped_ptr<ProfileParams> params(new ProfileParams); | 193   scoped_ptr<ProfileParams> params(new ProfileParams); | 
| 193   params->path = profile->GetPath(); | 194   params->path = profile->GetPath(); | 
| 194   params->is_incognito = profile->IsOffTheRecord(); | 195   params->is_incognito = profile->IsOffTheRecord(); | 
| 195   params->clear_local_state_on_exit = | 196   params->clear_local_state_on_exit = | 
| 196       pref_service->GetBoolean(prefs::kClearSiteDataOnExit); | 197       pref_service->GetBoolean(prefs::kClearSiteDataOnExit); | 
| 197 | 198 | 
| 198   params->appcache_service = profile->GetAppCacheService(); | 199   params->appcache_service = BrowserContext::GetAppCacheService(profile); | 
| 199 | 200 | 
| 200   // Set up Accept-Language and Accept-Charset header values | 201   // Set up Accept-Language and Accept-Charset header values | 
| 201   params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( | 202   params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( | 
| 202       pref_service->GetString(prefs::kAcceptLanguages)); | 203       pref_service->GetString(prefs::kAcceptLanguages)); | 
| 203   std::string default_charset = | 204   std::string default_charset = | 
| 204       pref_service->GetString(prefs::kGlobalDefaultCharset); | 205       pref_service->GetString(prefs::kGlobalDefaultCharset); | 
| 205   params->accept_charset = | 206   params->accept_charset = | 
| 206       net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); | 207       net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); | 
| 207 | 208 | 
| 208   // At this point, we don't know the charset of the referring page | 209   // At this point, we don't know the charset of the referring page | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 224 | 225 | 
| 225   params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 226   params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 
| 226   params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 227   params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 
| 227   params->host_zoom_map = profile->GetHostZoomMap(); | 228   params->host_zoom_map = profile->GetHostZoomMap(); | 
| 228   params->ssl_config_service = profile->GetSSLConfigService(); | 229   params->ssl_config_service = profile->GetSSLConfigService(); | 
| 229   base::Callback<Profile*(void)> profile_getter = | 230   base::Callback<Profile*(void)> profile_getter = | 
| 230       base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 231       base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 
| 231                  profile); | 232                  profile); | 
| 232   params->cookie_monster_delegate = | 233   params->cookie_monster_delegate = | 
| 233       new ChromeCookieMonsterDelegate(profile_getter); | 234       new ChromeCookieMonsterDelegate(profile_getter); | 
| 234   params->database_tracker = profile->GetDatabaseTracker(); | 235   params->database_tracker = BrowserContext::GetDatabaseTracker(profile); | 
| 235   params->appcache_service = profile->GetAppCacheService(); | 236   params->appcache_service = BrowserContext::GetAppCacheService(profile); | 
| 236   params->blob_storage_context = profile->GetBlobStorageContext(); | 237   params->blob_storage_context = BrowserContext::GetBlobStorageContext(profile); | 
| 237   params->file_system_context = profile->GetFileSystemContext(); | 238   params->file_system_context = BrowserContext::GetFileSystemContext(profile); | 
| 238   params->webkit_context = profile->GetWebKitContext(); | 239   params->webkit_context = BrowserContext::GetWebKitContext(profile); | 
| 239   params->quota_manager = profile->GetQuotaManager(); | 240   params->quota_manager = BrowserContext::GetQuotaManager(profile); | 
| 240   params->extension_info_map = profile->GetExtensionInfoMap(); | 241   params->extension_info_map = profile->GetExtensionInfoMap(); | 
| 241   params->notification_service = | 242   params->notification_service = | 
| 242       DesktopNotificationServiceFactory::GetForProfile(profile); | 243       DesktopNotificationServiceFactory::GetForProfile(profile); | 
| 243   params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 244   params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 
| 244 | 245 | 
| 245   ChromeProxyConfigService* proxy_config_service = | 246   ChromeProxyConfigService* proxy_config_service = | 
| 246       ProxyServiceFactory::CreateProxyConfigService(true); | 247       ProxyServiceFactory::CreateProxyConfigService(true); | 
| 247   params->proxy_config_service.reset(proxy_config_service); | 248   params->proxy_config_service.reset(proxy_config_service); | 
| 248   profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 249   profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 
| 249       proxy_config_service); | 250       proxy_config_service); | 
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 636           &resource_context_)); | 637           &resource_context_)); | 
| 637   bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 638   bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 
| 638   if (!posted) | 639   if (!posted) | 
| 639     delete this; | 640     delete this; | 
| 640 } | 641 } | 
| 641 | 642 | 
| 642 void ProfileIOData::set_origin_bound_cert_service( | 643 void ProfileIOData::set_origin_bound_cert_service( | 
| 643     net::OriginBoundCertService* origin_bound_cert_service) const { | 644     net::OriginBoundCertService* origin_bound_cert_service) const { | 
| 644   origin_bound_cert_service_.reset(origin_bound_cert_service); | 645   origin_bound_cert_service_.reset(origin_bound_cert_service); | 
| 645 } | 646 } | 
| OLD | NEW | 
|---|