Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: chrome/browser/profiles/profile_manager.h

Issue 1913373002: Revert "Refactor ProfileInfoCache in most of c/b/profiles" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
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_shortcut_manager.h" 25 #include "chrome/browser/profiles/profile_shortcut_manager.h"
26 #include "chrome/browser/ui/browser_list_observer.h" 26 #include "chrome/browser/ui/browser_list_observer.h"
27 #include "content/public/browser/notification_observer.h" 27 #include "content/public/browser/notification_observer.h"
28 #include "content/public/browser/notification_registrar.h" 28 #include "content/public/browser/notification_registrar.h"
29 29
30 class NewProfileLauncher; 30 class NewProfileLauncher;
31 class ProfileAttributesStorage;
32 class ProfileInfoCache; 31 class ProfileInfoCache;
33 32
34 class ProfileManager : public base::NonThreadSafe, 33 class ProfileManager : public base::NonThreadSafe,
35 public content::NotificationObserver, 34 public content::NotificationObserver,
36 public Profile::Delegate { 35 public Profile::Delegate {
37 public: 36 public:
38 typedef base::Callback<void(Profile*, Profile::CreateStatus)> CreateCallback; 37 typedef base::Callback<void(Profile*, Profile::CreateStatus)> CreateCallback;
39 typedef base::Callback<void(Profile*)> ProfileLoadedCallback; 38 typedef base::Callback<void(Profile*)> ProfileLoadedCallback;
40 39
41 explicit ProfileManager(const base::FilePath& user_data_dir); 40 explicit ProfileManager(const base::FilePath& user_data_dir);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Checks if any ephemeral profiles are left behind (e.g. because of a browser 201 // Checks if any ephemeral profiles are left behind (e.g. because of a browser
203 // crash) and schedule them for deletion. 202 // crash) and schedule them for deletion.
204 void CleanUpEphemeralProfiles(); 203 void CleanUpEphemeralProfiles();
205 204
206 // Initializes user prefs of |profile|. This includes profile name and 205 // Initializes user prefs of |profile|. This includes profile name and
207 // avatar values. 206 // avatar values.
208 void InitProfileUserPrefs(Profile* profile); 207 void InitProfileUserPrefs(Profile* profile);
209 208
210 // Register and add testing profile to the ProfileManager. Use ONLY in tests. 209 // Register and add testing profile to the ProfileManager. Use ONLY in tests.
211 // This allows the creation of Profiles outside of the standard creation path 210 // This allows the creation of Profiles outside of the standard creation path
212 // for testing. If |addToStorage|, adds to ProfileAttributesStorage as well. 211 // for testing. If |addToCache|, adds to ProfileInfoCache as well.
213 // If |start_deferred_task_runners|, starts the deferred task runners. 212 // If |start_deferred_task_runners|, starts the deferred task runners.
214 // Use ONLY in tests. 213 // Use ONLY in tests.
215 void RegisterTestingProfile(Profile* profile, 214 void RegisterTestingProfile(Profile* profile,
216 bool addToStorage, 215 bool addToCache,
217 bool start_deferred_task_runners); 216 bool start_deferred_task_runners);
218 217
219 const base::FilePath& user_data_dir() const { return user_data_dir_; } 218 const base::FilePath& user_data_dir() const { return user_data_dir_; }
220 219
221 // For ChromeOS, determines if the user has logged in to a real profile. 220 // For ChromeOS, determines if the user has logged in to a real profile.
222 bool IsLoggedIn() const { return logged_in_; } 221 bool IsLoggedIn() const { return logged_in_; }
223 222
224 // content::NotificationObserver implementation. 223 // content::NotificationObserver implementation.
225 void Observe(int type, 224 void Observe(int type,
226 const content::NotificationSource& source, 225 const content::NotificationSource& source,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 301
303 // Returns ProfileInfo associated with given |path|, registered earlier with 302 // Returns ProfileInfo associated with given |path|, registered earlier with
304 // RegisterProfile. 303 // RegisterProfile.
305 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const; 304 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const;
306 305
307 // Returns a registered profile. In contrast to GetProfileByPath(), this will 306 // Returns a registered profile. In contrast to GetProfileByPath(), this will
308 // also return a profile that is not fully initialized yet, so this method 307 // also return a profile that is not fully initialized yet, so this method
309 // should be used carefully. 308 // should be used carefully.
310 Profile* GetProfileByPathInternal(const base::FilePath& path) const; 309 Profile* GetProfileByPathInternal(const base::FilePath& path) const;
311 310
312 // Adds |profile| to the profile attributes storage if it hasn't been added 311 // Adds |profile| to the profile info cache if it hasn't been added yet.
313 // yet. 312 void AddProfileToCache(Profile* profile);
314 void AddProfileToStorage(Profile* profile);
315 313
316 // Apply settings for profiles created by the system rather than users: The 314 // Apply settings for profiles created by the system rather than users: The
317 // (desktop) Guest User profile and (desktop) System Profile. 315 // (desktop) Guest User profile and (desktop) System Profile.
318 void SetNonPersonalProfilePrefs(Profile* profile); 316 void SetNonPersonalProfilePrefs(Profile* profile);
319 317
320 // For ChromeOS, determines if profile should be otr. 318 // For ChromeOS, determines if profile should be otr.
321 bool ShouldGoOffTheRecord(Profile* profile); 319 bool ShouldGoOffTheRecord(Profile* profile);
322 320
323 void RunCallbacks(const std::vector<CreateCallback>& callbacks, 321 void RunCallbacks(const std::vector<CreateCallback>& callbacks,
324 Profile* profile, 322 Profile* profile,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 class ProfileManagerWithoutInit : public ProfileManager { 402 class ProfileManagerWithoutInit : public ProfileManager {
405 public: 403 public:
406 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); 404 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir);
407 405
408 protected: 406 protected:
409 void DoFinalInitForServices(Profile*, bool) override {} 407 void DoFinalInitForServices(Profile*, bool) override {}
410 void DoFinalInitLogging(Profile*) override {} 408 void DoFinalInitLogging(Profile*) override {}
411 }; 409 };
412 410
413 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 411 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_list_desktop_browsertest.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698