| 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" | 
|   11 #include "base/file_path.h" |   11 #include "base/file_path.h" | 
|   12 #include "base/file_util.h" |   12 #include "base/file_util.h" | 
|   13 #include "base/memory/scoped_ptr.h" |   13 #include "base/memory/scoped_ptr.h" | 
|   14 #include "base/path_service.h" |   14 #include "base/path_service.h" | 
|   15 #include "base/string_util.h" |   15 #include "base/string_util.h" | 
|   16 #include "build/build_config.h" |   16 #include "build/build_config.h" | 
|   17 #include "chrome/browser/background_contents_service.h" |   17 #include "chrome/browser/background_contents_service.h" | 
|   18 #include "chrome/browser/browser_process.h" |   18 #include "chrome/browser/browser_process.h" | 
|   19 #include "chrome/browser/content_settings/host_content_settings_map.h" |   19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 
|   20 #include "chrome/browser/download/download_manager.h" |   20 #include "chrome/browser/download/download_manager.h" | 
|   21 #include "chrome/browser/extensions/extension_message_service.h" |   21 #include "chrome/browser/extensions/extension_message_service.h" | 
|   22 #include "chrome/browser/extensions/extension_pref_store.h" |   22 #include "chrome/browser/extensions/extension_pref_store.h" | 
|   23 #include "chrome/browser/extensions/extension_process_manager.h" |   23 #include "chrome/browser/extensions/extension_process_manager.h" | 
|   24 #include "chrome/browser/extensions/extension_special_storage_policy.h" |   24 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 
|   25 #include "chrome/browser/net/pref_proxy_config_service.h" |   25 #include "chrome/browser/net/pref_proxy_config_service.h" | 
|   26 #include "chrome/browser/notifications/desktop_notification_service.h" |  | 
|   27 #include "chrome/browser/prefs/pref_service.h" |   26 #include "chrome/browser/prefs/pref_service.h" | 
|   28 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |   27 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 
|   29 #include "chrome/browser/profiles/profile_dependency_manager.h" |   28 #include "chrome/browser/profiles/profile_dependency_manager.h" | 
|   30 #include "chrome/browser/ssl/ssl_host_state.h" |   29 #include "chrome/browser/ssl/ssl_host_state.h" | 
|   31 #include "chrome/browser/sync/profile_sync_service.h" |   30 #include "chrome/browser/sync/profile_sync_service.h" | 
|   32 #include "chrome/browser/themes/theme_service.h" |   31 #include "chrome/browser/themes/theme_service.h" | 
|   33 #include "chrome/browser/transport_security_persister.h" |   32 #include "chrome/browser/transport_security_persister.h" | 
|   34 #include "chrome/browser/ui/browser_list.h" |   33 #include "chrome/browser/ui/browser_list.h" | 
|   35 #include "chrome/browser/ui/find_bar/find_bar_state.h" |   34 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 
|   36 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |   35 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  498   } |  497   } | 
|  499  |  498  | 
|  500   virtual BookmarkModel* GetBookmarkModel() { |  499   virtual BookmarkModel* GetBookmarkModel() { | 
|  501     return profile_->GetBookmarkModel(); |  500     return profile_->GetBookmarkModel(); | 
|  502   } |  501   } | 
|  503  |  502  | 
|  504   virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() { |  503   virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() { | 
|  505     return profile_->GetProtocolHandlerRegistry(); |  504     return profile_->GetProtocolHandlerRegistry(); | 
|  506   } |  505   } | 
|  507  |  506  | 
|  508   virtual DesktopNotificationService* GetDesktopNotificationService() { |  | 
|  509     if (!desktop_notification_service_.get()) { |  | 
|  510       desktop_notification_service_.reset(new DesktopNotificationService( |  | 
|  511           this, g_browser_process->notification_ui_manager())); |  | 
|  512     } |  | 
|  513     return desktop_notification_service_.get(); |  | 
|  514   } |  | 
|  515  |  | 
|  516   virtual TokenService* GetTokenService() { |  507   virtual TokenService* GetTokenService() { | 
|  517     return NULL; |  508     return NULL; | 
|  518   } |  509   } | 
|  519  |  510  | 
|  520   virtual ProfileSyncService* GetProfileSyncService() { |  511   virtual ProfileSyncService* GetProfileSyncService() { | 
|  521     return NULL; |  512     return NULL; | 
|  522   } |  513   } | 
|  523  |  514  | 
|  524   virtual ProfileSyncService* GetProfileSyncService( |  515   virtual ProfileSyncService* GetProfileSyncService( | 
|  525       const std::string& cros_user) { |  516       const std::string& cros_user) { | 
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  695   // Weak pointer owned by |profile_|. |  686   // Weak pointer owned by |profile_|. | 
|  696   PrefService* prefs_; |  687   PrefService* prefs_; | 
|  697  |  688  | 
|  698   scoped_ptr<ExtensionProcessManager> extension_process_manager_; |  689   scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 
|  699  |  690  | 
|  700   OffTheRecordProfileIOData::Handle io_data_; |  691   OffTheRecordProfileIOData::Handle io_data_; | 
|  701  |  692  | 
|  702   // The download manager that only stores downloaded items in memory. |  693   // The download manager that only stores downloaded items in memory. | 
|  703   scoped_refptr<DownloadManager> download_manager_; |  694   scoped_refptr<DownloadManager> download_manager_; | 
|  704  |  695  | 
|  705   // Use a separate desktop notification service for OTR. |  | 
|  706   scoped_ptr<DesktopNotificationService> desktop_notification_service_; |  | 
|  707  |  | 
|  708   // We use a non-writable content settings map for OTR. |  696   // We use a non-writable content settings map for OTR. | 
|  709   scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |  697   scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 
|  710  |  698  | 
|  711   // Use a separate zoom map for OTR. |  699   // Use a separate zoom map for OTR. | 
|  712   scoped_refptr<HostZoomMap> host_zoom_map_; |  700   scoped_refptr<HostZoomMap> host_zoom_map_; | 
|  713  |  701  | 
|  714   // Use a special WebKit context for OTR browsing. |  702   // Use a special WebKit context for OTR browsing. | 
|  715   scoped_refptr<WebKitContext> webkit_context_; |  703   scoped_refptr<WebKitContext> webkit_context_; | 
|  716  |  704  | 
|  717   // We don't want SSLHostState from the OTR profile to leak back to the main |  705   // We don't want SSLHostState from the OTR profile to leak back to the main | 
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  780 }; |  768 }; | 
|  781 #endif |  769 #endif | 
|  782  |  770  | 
|  783 Profile* Profile::CreateOffTheRecordProfile() { |  771 Profile* Profile::CreateOffTheRecordProfile() { | 
|  784 #if defined(OS_CHROMEOS) |  772 #if defined(OS_CHROMEOS) | 
|  785   if (Profile::IsGuestSession()) |  773   if (Profile::IsGuestSession()) | 
|  786     return new GuestSessionProfile(this); |  774     return new GuestSessionProfile(this); | 
|  787 #endif |  775 #endif | 
|  788   return new OffTheRecordProfileImpl(this); |  776   return new OffTheRecordProfileImpl(this); | 
|  789 } |  777 } | 
| OLD | NEW |