| 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_impl.h" | 5 #include "chrome/browser/profiles/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/environment.h" | 10 #include "base/environment.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #include "chrome/common/render_messages.h" | 98 #include "chrome/common/render_messages.h" |
| 99 #include "chrome/common/spellcheck_messages.h" | 99 #include "chrome/common/spellcheck_messages.h" |
| 100 #include "chrome/common/url_constants.h" | 100 #include "chrome/common/url_constants.h" |
| 101 #include "content/browser/appcache/chrome_appcache_service.h" | 101 #include "content/browser/appcache/chrome_appcache_service.h" |
| 102 #include "content/browser/chrome_blob_storage_context.h" | 102 #include "content/browser/chrome_blob_storage_context.h" |
| 103 #include "content/browser/file_system/browser_file_system_helper.h" | 103 #include "content/browser/file_system/browser_file_system_helper.h" |
| 104 #include "content/browser/host_zoom_map.h" | 104 #include "content/browser/host_zoom_map.h" |
| 105 #include "content/browser/in_process_webkit/webkit_context.h" | 105 #include "content/browser/in_process_webkit/webkit_context.h" |
| 106 #include "content/browser/speech/speech_input_manager.h" | 106 #include "content/browser/speech/speech_input_manager.h" |
| 107 #include "content/browser/ssl/ssl_host_state.h" | 107 #include "content/browser/ssl/ssl_host_state.h" |
| 108 #include "content/browser/user_metrics.h" | |
| 109 #include "content/public/browser/browser_thread.h" | 108 #include "content/public/browser/browser_thread.h" |
| 110 #include "content/public/browser/notification_service.h" | 109 #include "content/public/browser/notification_service.h" |
| 111 #include "content/public/browser/render_process_host.h" | 110 #include "content/public/browser/render_process_host.h" |
| 111 #include "content/public/browser/user_metrics.h" |
| 112 #include "grit/locale_settings.h" | 112 #include "grit/locale_settings.h" |
| 113 #include "net/base/transport_security_state.h" | 113 #include "net/base/transport_security_state.h" |
| 114 #include "net/http/http_server_properties.h" | 114 #include "net/http/http_server_properties.h" |
| 115 #include "webkit/database/database_tracker.h" | 115 #include "webkit/database/database_tracker.h" |
| 116 #include "webkit/quota/quota_manager.h" | 116 #include "webkit/quota/quota_manager.h" |
| 117 | 117 |
| 118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
| 119 #include "chrome/browser/instant/promo_counter.h" | 119 #include "chrome/browser/instant/promo_counter.h" |
| 120 #include "chrome/browser/password_manager/password_store_win.h" | 120 #include "chrome/browser/password_manager/password_store_win.h" |
| 121 #include "chrome/installer/util/install_util.h" | 121 #include "chrome/installer/util/install_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 #if defined(OS_CHROMEOS) | 137 #if defined(OS_CHROMEOS) |
| 138 #include "chrome/browser/chromeos/locale_change_guard.h" | 138 #include "chrome/browser/chromeos/locale_change_guard.h" |
| 139 #include "chrome/browser/chromeos/login/user_manager.h" | 139 #include "chrome/browser/chromeos/login/user_manager.h" |
| 140 #include "chrome/browser/chromeos/preferences.h" | 140 #include "chrome/browser/chromeos/preferences.h" |
| 141 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 141 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 142 #endif | 142 #endif |
| 143 | 143 |
| 144 using base::Time; | 144 using base::Time; |
| 145 using base::TimeDelta; | 145 using base::TimeDelta; |
| 146 using content::BrowserThread; | 146 using content::BrowserThread; |
| 147 using content::UserMetricsAction; |
| 147 | 148 |
| 148 namespace { | 149 namespace { |
| 149 | 150 |
| 150 // Delay, in milliseconds, before we explicitly create the SessionService. | 151 // Delay, in milliseconds, before we explicitly create the SessionService. |
| 151 static const int kCreateSessionServiceDelayMS = 500; | 152 static const int kCreateSessionServiceDelayMS = 500; |
| 152 | 153 |
| 153 #if defined(OS_MACOSX) | 154 #if defined(OS_MACOSX) |
| 154 // Capacity for mock keychain used for testing. | 155 // Capacity for mock keychain used for testing. |
| 155 static const int kMockKeychainSize = 1000; | 156 static const int kMockKeychainSize = 1000; |
| 156 #endif | 157 #endif |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 #endif | 340 #endif |
| 340 if (init_background_mode_manager) { | 341 if (init_background_mode_manager) { |
| 341 if (g_browser_process->background_mode_manager()) | 342 if (g_browser_process->background_mode_manager()) |
| 342 g_browser_process->background_mode_manager()->RegisterProfile(this); | 343 g_browser_process->background_mode_manager()->RegisterProfile(this); |
| 343 } | 344 } |
| 344 | 345 |
| 345 InitRegisteredProtocolHandlers(); | 346 InitRegisteredProtocolHandlers(); |
| 346 | 347 |
| 347 clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit); | 348 clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit); |
| 348 if (clear_local_state_on_exit_) { | 349 if (clear_local_state_on_exit_) { |
| 349 UserMetrics::RecordAction( | 350 content::RecordAction( |
| 350 UserMetricsAction("ClearSiteDataOnExitEnabled")); | 351 UserMetricsAction("ClearSiteDataOnExitEnabled")); |
| 351 } else { | 352 } else { |
| 352 UserMetrics::RecordAction( | 353 content::RecordAction( |
| 353 UserMetricsAction("ClearSiteDataOnExitDisabled")); | 354 UserMetricsAction("ClearSiteDataOnExitDisabled")); |
| 354 } | 355 } |
| 355 | 356 |
| 356 InstantController::RecordMetrics(this); | 357 InstantController::RecordMetrics(this); |
| 357 | 358 |
| 358 // Instantiates Metrics object for spellchecking for use. | 359 // Instantiates Metrics object for spellchecking for use. |
| 359 if (g_browser_process->metrics_service() && | 360 if (g_browser_process->metrics_service() && |
| 360 g_browser_process->metrics_service()->recording_active()) | 361 g_browser_process->metrics_service()->recording_active()) |
| 361 GetSpellCheckProfile()->StartRecordingMetrics( | 362 GetSpellCheckProfile()->StartRecordingMetrics( |
| 362 GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); | 363 GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1670 FilePath* cache_path, | 1671 FilePath* cache_path, |
| 1671 int* max_size) { | 1672 int* max_size) { |
| 1672 DCHECK(cache_path); | 1673 DCHECK(cache_path); |
| 1673 DCHECK(max_size); | 1674 DCHECK(max_size); |
| 1674 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1675 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1675 if (!path.empty()) | 1676 if (!path.empty()) |
| 1676 *cache_path = path; | 1677 *cache_path = path; |
| 1677 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1678 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1678 prefs_->GetInteger(prefs::kDiskCacheSize); | 1679 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1679 } | 1680 } |
| OLD | NEW |