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