| 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/command_line.h" | 7 #include "base/command_line.h" | 
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" | 
| 9 #include "base/environment.h" | 9 #include "base/environment.h" | 
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" | 
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" | 
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" | 
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" | 
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" | 
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" | 
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" | 
| 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 
| 18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" | 
| 19 #include "chrome/browser/background_contents_service.h" | 19 #include "chrome/browser/background_contents_service_factory.h" | 
| 20 #include "chrome/browser/background_mode_manager.h" | 20 #include "chrome/browser/background_mode_manager_factory.h" | 
| 21 #include "chrome/browser/bookmarks/bookmark_model.h" | 21 #include "chrome/browser/bookmarks/bookmark_model.h" | 
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" | 
| 23 #include "chrome/browser/browser_signin.h" | 23 #include "chrome/browser/browser_signin.h" | 
| 24 #include "chrome/browser/content_settings/host_content_settings_map.h" | 24 #include "chrome/browser/content_settings/host_content_settings_map.h" | 
| 25 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 25 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 
| 26 #include "chrome/browser/defaults.h" | 26 #include "chrome/browser/defaults.h" | 
| 27 #include "chrome/browser/download/download_manager.h" | 27 #include "chrome/browser/download/download_manager.h" | 
| 28 #include "chrome/browser/extensions/default_apps.h" | 28 #include "chrome/browser/extensions/default_apps.h" | 
| 29 #include "chrome/browser/extensions/extension_devtools_manager.h" | 29 #include "chrome/browser/extensions/extension_devtools_manager.h" | 
| 30 #include "chrome/browser/extensions/extension_error_reporter.h" | 30 #include "chrome/browser/extensions/extension_error_reporter.h" | 
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 290       SSLConfigServiceManager::CreateDefaultManager(GetPrefs(), local_state)); | 290       SSLConfigServiceManager::CreateDefaultManager(GetPrefs(), local_state)); | 
| 291 | 291 | 
| 292   PinnedTabServiceFactory::GetForProfile(this); | 292   PinnedTabServiceFactory::GetForProfile(this); | 
| 293 | 293 | 
| 294   // Initialize the BackgroundModeManager - this has to be done here before | 294   // Initialize the BackgroundModeManager - this has to be done here before | 
| 295   // InitExtensions() is called because it relies on receiving notifications | 295   // InitExtensions() is called because it relies on receiving notifications | 
| 296   // when extensions are loaded. BackgroundModeManager is not needed under | 296   // when extensions are loaded. BackgroundModeManager is not needed under | 
| 297   // ChromeOS because Chrome is always running (no need for special keep-alive | 297   // ChromeOS because Chrome is always running (no need for special keep-alive | 
| 298   // or launch-on-startup support). | 298   // or launch-on-startup support). | 
| 299 #if !defined(OS_CHROMEOS) | 299 #if !defined(OS_CHROMEOS) | 
| 300   background_mode_manager_.reset(new BackgroundModeManager(this, | 300   BackgroundModeManagerFactory::GetForProfile(this); | 
| 301       CommandLine::ForCurrentProcess())); |  | 
| 302 #endif | 301 #endif | 
| 303 | 302 | 
| 304   background_contents_service_.reset( | 303   BackgroundContentsServiceFactory::GetForProfile(this); | 
| 305       new BackgroundContentsService(this, CommandLine::ForCurrentProcess())); |  | 
| 306 | 304 | 
| 307   extension_info_map_ = new ExtensionInfoMap(); | 305   extension_info_map_ = new ExtensionInfoMap(); | 
| 308 | 306 | 
| 309   InitRegisteredProtocolHandlers(); | 307   InitRegisteredProtocolHandlers(); | 
| 310 | 308 | 
| 311   clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit); | 309   clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit); | 
| 312 | 310 | 
| 313   // Log the profile size after a reasonable startup delay. | 311   // Log the profile size after a reasonable startup delay. | 
| 314   BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, | 312   BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, | 
| 315                                  new ProfileSizeTask(path_), 112000); | 313                                  new ProfileSizeTask(path_), 112000); | 
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 676     visited_link_master_.swap(visited_links); | 674     visited_link_master_.swap(visited_links); | 
| 677   } | 675   } | 
| 678 | 676 | 
| 679   return visited_link_master_.get(); | 677   return visited_link_master_.get(); | 
| 680 } | 678 } | 
| 681 | 679 | 
| 682 ExtensionService* ProfileImpl::GetExtensionService() { | 680 ExtensionService* ProfileImpl::GetExtensionService() { | 
| 683   return extensions_service_.get(); | 681   return extensions_service_.get(); | 
| 684 } | 682 } | 
| 685 | 683 | 
| 686 BackgroundContentsService* ProfileImpl::GetBackgroundContentsService() const { |  | 
| 687   return background_contents_service_.get(); |  | 
| 688 } |  | 
| 689 |  | 
| 690 StatusTray* ProfileImpl::GetStatusTray() { | 684 StatusTray* ProfileImpl::GetStatusTray() { | 
| 691   if (!status_tray_.get()) | 685   if (!status_tray_.get()) | 
| 692     status_tray_.reset(StatusTray::Create()); | 686     status_tray_.reset(StatusTray::Create()); | 
| 693   return status_tray_.get(); | 687   return status_tray_.get(); | 
| 694 } | 688 } | 
| 695 | 689 | 
| 696 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { | 690 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { | 
| 697   return user_script_master_.get(); | 691   return user_script_master_.get(); | 
| 698 } | 692 } | 
| 699 | 693 | 
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1490   return pref_proxy_config_tracker_; | 1484   return pref_proxy_config_tracker_; | 
| 1491 } | 1485 } | 
| 1492 | 1486 | 
| 1493 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1487 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { | 
| 1494   if (!prerender::PrerenderManager::IsPrerenderingPossible()) | 1488   if (!prerender::PrerenderManager::IsPrerenderingPossible()) | 
| 1495     return NULL; | 1489     return NULL; | 
| 1496   if (!prerender_manager_) | 1490   if (!prerender_manager_) | 
| 1497     prerender_manager_ = new prerender::PrerenderManager(this); | 1491     prerender_manager_ = new prerender::PrerenderManager(this); | 
| 1498   return prerender_manager_; | 1492   return prerender_manager_; | 
| 1499 } | 1493 } | 
| OLD | NEW | 
|---|