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> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // TODO(skuhne): Move into ash's new user management function. | 73 // TODO(skuhne): Move into ash's new user management function. |
74 static Profile* GetPrimaryUserProfile(); | 74 static Profile* GetPrimaryUserProfile(); |
75 | 75 |
76 // Get the profile for the currently active user. | 76 // Get the profile for the currently active user. |
77 // Note that in case of a guest account this will return a 'suitable' profile. | 77 // Note that in case of a guest account this will return a 'suitable' profile. |
78 // This function is temporary and will soon be moved to ash. As such avoid | 78 // This function is temporary and will soon be moved to ash. As such avoid |
79 // using it at all cost. | 79 // using it at all cost. |
80 // TODO(skuhne): Move into ash's new user management function. | 80 // TODO(skuhne): Move into ash's new user management function. |
81 static Profile* GetActiveUserProfile(); | 81 static Profile* GetActiveUserProfile(); |
82 | 82 |
| 83 // Load and return the initial profile for browser. On ChromeOS, this returns |
| 84 // either the sign-in profile or the active user profile depending on whether |
| 85 // browser is started normally or is restarted after crash. On other |
| 86 // platforms, this returns the default profile. |
| 87 static Profile* CreateInitialProfile(); |
| 88 |
83 // Returns a profile for a specific profile directory within the user data | 89 // Returns a profile for a specific profile directory within the user data |
84 // dir. This will return an existing profile it had already been created, | 90 // dir. This will return an existing profile it had already been created, |
85 // otherwise it will create and manage it. | 91 // otherwise it will create and manage it. |
86 // Because this method might synchronously create a new profile, it should | 92 // Because this method might synchronously create a new profile, it should |
87 // only be called for the initial profile or in tests, where blocking is | 93 // only be called for the initial profile or in tests, where blocking is |
88 // acceptable. Returns null if creation of the new profile fails. | 94 // acceptable. Returns null if creation of the new profile fails. |
89 // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then | 95 // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then |
90 // make this method private. | 96 // make this method private. |
91 Profile* GetProfile(const base::FilePath& profile_dir); | 97 Profile* GetProfile(const base::FilePath& profile_dir); |
92 | 98 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 class ProfileManagerWithoutInit : public ProfileManager { | 450 class ProfileManagerWithoutInit : public ProfileManager { |
445 public: | 451 public: |
446 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 452 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
447 | 453 |
448 protected: | 454 protected: |
449 void DoFinalInitForServices(Profile*, bool) override {} | 455 void DoFinalInitForServices(Profile*, bool) override {} |
450 void DoFinalInitLogging(Profile*) override {} | 456 void DoFinalInitLogging(Profile*) override {} |
451 }; | 457 }; |
452 | 458 |
453 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 459 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |