| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| 8 |
| 7 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 11 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 12 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 13 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 14 #include "chrome/browser/background_contents_service.h" | 16 #include "chrome/browser/background_contents_service.h" |
| 15 #include "chrome/browser/browser_list.h" | 17 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/browser_thread.h" | 19 #include "chrome/browser/browser_thread.h" |
| 18 #include "chrome/browser/chrome_blob_storage_context.h" | 20 #include "chrome/browser/chrome_blob_storage_context.h" |
| 19 #include "chrome/browser/download/download_manager.h" | 21 #include "chrome/browser/download/download_manager.h" |
| 20 #include "chrome/browser/extensions/extension_message_service.h" | 22 #include "chrome/browser/extensions/extension_message_service.h" |
| 21 #include "chrome/browser/extensions/extension_process_manager.h" | 23 #include "chrome/browser/extensions/extension_process_manager.h" |
| 22 #include "chrome/browser/file_system/browser_file_system_helper.h" | 24 #include "chrome/browser/file_system/browser_file_system_helper.h" |
| 23 #include "chrome/browser/in_process_webkit/webkit_context.h" | 25 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 24 #include "chrome/browser/net/chrome_url_request_context.h" | 26 #include "chrome/browser/net/chrome_url_request_context.h" |
| 25 #include "chrome/browser/notifications/desktop_notification_service.h" | 27 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 26 #include "chrome/browser/ssl/ssl_host_state.h" | 28 #include "chrome/browser/ssl/ssl_host_state.h" |
| 27 #include "chrome/browser/sync/profile_sync_service.h" | 29 #include "chrome/browser/sync/profile_sync_service.h" |
| 28 #include "chrome/browser/themes/browser_theme_provider.h" | 30 #include "chrome/browser/themes/browser_theme_provider.h" |
| 29 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 31 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 30 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/chrome_switches.h" | |
| 33 #include "chrome/common/json_pref_store.h" | 34 #include "chrome/common/json_pref_store.h" |
| 34 #include "chrome/common/notification_service.h" | 35 #include "chrome/common/notification_service.h" |
| 35 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 36 #include "chrome/common/render_messages.h" | 37 #include "chrome/common/render_messages.h" |
| 37 #include "grit/browser_resources.h" | 38 #include "grit/browser_resources.h" |
| 38 #include "grit/locale_settings.h" | 39 #include "grit/locale_settings.h" |
| 39 #include "net/base/transport_security_state.h" | 40 #include "net/base/transport_security_state.h" |
| 40 #include "webkit/database/database_tracker.h" | 41 #include "webkit/database/database_tracker.h" |
| 42 |
| 41 #if defined(TOOLKIT_USES_GTK) | 43 #if defined(TOOLKIT_USES_GTK) |
| 42 #include "chrome/browser/gtk/gtk_theme_provider.h" | 44 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 43 #endif | 45 #endif |
| 44 | 46 |
| 45 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 46 #include "chrome/browser/password_manager/password_store_win.h" | 48 #include "chrome/browser/password_manager/password_store_win.h" |
| 47 #elif defined(OS_MACOSX) | 49 #elif defined(OS_MACOSX) |
| 48 #include "chrome/browser/keychain_mac.h" | 50 #include "chrome/browser/keychain_mac.h" |
| 49 #include "chrome/browser/password_manager/password_store_mac.h" | 51 #include "chrome/browser/password_manager/password_store_mac.h" |
| 50 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) | 52 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 URLRequestContextGetter* Profile::default_request_context_; | 63 URLRequestContextGetter* Profile::default_request_context_; |
| 62 | 64 |
| 63 namespace { | 65 namespace { |
| 64 | 66 |
| 65 // TODO(pathorn): Duplicated in profile_impl.cc | 67 // TODO(pathorn): Duplicated in profile_impl.cc |
| 66 void CleanupRequestContext(ChromeURLRequestContextGetter* context) { | 68 void CleanupRequestContext(ChromeURLRequestContextGetter* context) { |
| 67 if (context) | 69 if (context) |
| 68 context->CleanupOnUIThread(); | 70 context->CleanupOnUIThread(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 } // namespace | 73 } // namespace |
| 72 | 74 |
| 73 Profile::Profile() | 75 Profile::Profile() |
| 74 : restored_last_session_(false), | 76 : restored_last_session_(false), |
| 75 accessibility_pause_level_(0) { | 77 accessibility_pause_level_(0) { |
| 76 } | 78 } |
| 77 | 79 |
| 78 // static | 80 // static |
| 79 const ProfileId Profile::InvalidProfileId = static_cast<ProfileId>(0); | 81 const ProfileId Profile::InvalidProfileId = static_cast<ProfileId>(0); |
| 80 | 82 |
| 81 // static | 83 // static |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 673 |
| 672 // The file_system context for this profile. | 674 // The file_system context for this profile. |
| 673 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; | 675 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
| 674 | 676 |
| 675 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); | 677 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
| 676 }; | 678 }; |
| 677 | 679 |
| 678 Profile* Profile::CreateOffTheRecordProfile() { | 680 Profile* Profile::CreateOffTheRecordProfile() { |
| 679 return new OffTheRecordProfileImpl(this); | 681 return new OffTheRecordProfileImpl(this); |
| 680 } | 682 } |
| OLD | NEW |