| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This class keeps track of the currently-active profiles in the runtime. | 5 // This class keeps track of the currently-active profiles in the runtime. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 | 11 |
| 12 #include <list> | 12 #include <list> |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 17 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/memory/linked_ptr.h" | 20 #include "base/memory/linked_ptr.h" |
| 21 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
| 22 #include "base/threading/non_thread_safe.h" | 22 #include "base/threading/non_thread_safe.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_metrics.h" |
| 25 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 26 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 26 #include "chrome/browser/ui/browser_list_observer.h" | 27 #include "chrome/browser/ui/browser_list_observer.h" |
| 27 #include "content/public/browser/notification_observer.h" | 28 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 29 #include "content/public/browser/notification_registrar.h" |
| 29 | 30 |
| 30 class NewProfileLauncher; | 31 class NewProfileLauncher; |
| 31 class ProfileAttributesStorage; | 32 class ProfileAttributesStorage; |
| 32 class ProfileInfoCache; | 33 class ProfileInfoCache; |
| 33 | 34 |
| 34 class ProfileManager : public base::NonThreadSafe, | 35 class ProfileManager : public base::NonThreadSafe, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 183 |
| 183 // Returns a ProfileAttributesStorage object which can be used to get | 184 // Returns a ProfileAttributesStorage object which can be used to get |
| 184 // information about profiles without having to load them from disk. | 185 // information about profiles without having to load them from disk. |
| 185 ProfileAttributesStorage& GetProfileAttributesStorage(); | 186 ProfileAttributesStorage& GetProfileAttributesStorage(); |
| 186 | 187 |
| 187 // Returns a ProfileShortcut Manager that enables the caller to create | 188 // Returns a ProfileShortcut Manager that enables the caller to create |
| 188 // profile specfic desktop shortcuts. | 189 // profile specfic desktop shortcuts. |
| 189 ProfileShortcutManager* profile_shortcut_manager(); | 190 ProfileShortcutManager* profile_shortcut_manager(); |
| 190 | 191 |
| 191 #if !defined(OS_ANDROID) | 192 #if !defined(OS_ANDROID) |
| 193 // Less strict version of ScheduleProfileForDeletion(), silently fail if |
| 194 // profile already marked for deletion. Returns true if the profile scheduled |
| 195 // for deletion. |
| 196 bool MaybeScheduleProfileForDeletion( |
| 197 const base::FilePath& profile_dir, |
| 198 const CreateCallback& callback, |
| 199 ProfileMetrics::ProfileDelete deletion_source); |
| 200 |
| 192 // Schedules the profile at the given path to be deleted on shutdown. If we're | 201 // Schedules the profile at the given path to be deleted on shutdown. If we're |
| 193 // deleting the last profile, a new one will be created in its place, and in | 202 // deleting the last profile, a new one will be created in its place, and in |
| 194 // that case the callback will be called when profile creation is complete. | 203 // that case the callback will be called when profile creation is complete. |
| 195 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, | 204 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, |
| 196 const CreateCallback& callback); | 205 const CreateCallback& callback); |
| 197 #endif | 206 #endif |
| 198 | 207 |
| 199 // Autoloads profiles if they are running background apps. | 208 // Autoloads profiles if they are running background apps. |
| 200 void AutoloadProfiles(); | 209 void AutoloadProfiles(); |
| 201 | 210 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 class ProfileManagerWithoutInit : public ProfileManager { | 413 class ProfileManagerWithoutInit : public ProfileManager { |
| 405 public: | 414 public: |
| 406 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 415 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
| 407 | 416 |
| 408 protected: | 417 protected: |
| 409 void DoFinalInitForServices(Profile*, bool) override {} | 418 void DoFinalInitForServices(Profile*, bool) override {} |
| 410 void DoFinalInitLogging(Profile*) override {} | 419 void DoFinalInitLogging(Profile*) override {} |
| 411 }; | 420 }; |
| 412 | 421 |
| 413 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 422 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| OLD | NEW |