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 | |
emaxx
2017/06/08 19:43:54
Hmm, does the function really behave like that? It
xiyuan
2017/06/08 20:30:40
|logged_in_| is only set for ChromeOS. So for othe
| |
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 class ProfileManagerWithoutInit : public ProfileManager { | 447 class ProfileManagerWithoutInit : public ProfileManager { |
442 public: | 448 public: |
443 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 449 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
444 | 450 |
445 protected: | 451 protected: |
446 void DoFinalInitForServices(Profile*, bool) override {} | 452 void DoFinalInitForServices(Profile*, bool) override {} |
447 void DoFinalInitLogging(Profile*) override {} | 453 void DoFinalInitLogging(Profile*) override {} |
448 }; | 454 }; |
449 | 455 |
450 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 456 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |