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

Unified Diff: chrome/browser/profiles/profile_manager.h

Issue 1782443006: Create LoadProfile method in profile_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_manager.h
diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h
index b4db4fbcb0e3b288c9597ed570d2f79cdad1bcbe..b88c7e9fd070d3c0ff03a73bde0f4b46714cee63 100644
--- a/chrome/browser/profiles/profile_manager.h
+++ b/chrome/browser/profiles/profile_manager.h
@@ -35,6 +35,7 @@ class ProfileManager : public base::NonThreadSafe,
public Profile::Delegate {
public:
typedef base::Callback<void(Profile*, Profile::CreateStatus)> CreateCallback;
+ typedef base::Callback<void(Profile*)> ProfileLoadedCallback;
explicit ProfileManager(const base::FilePath& user_data_dir);
~ProfileManager() override;
@@ -87,6 +88,18 @@ class ProfileManager : public base::NonThreadSafe,
// Returns total number of profiles available on this machine.
size_t GetNumberOfProfiles();
+ // Asynchronously loads an existing profile given its |profile_name| within
+ // the user data directory, optionally in |incognito| mode. The |callback|
+ // will be called with the Profile when it has been loaded, or with a nullptr
+ // otherwise. Should be called on the UI thread.
+ // Unlike CreateProfileAsync this will not create a profile if one doesn't
+ // already exist on disk
+ // Returns true if the profile exists, but the final loaded profile will come
+ // as part of the callback.
+ bool LoadProfile(const std::string& profile_name,
+ bool incognito,
+ const ProfileLoadedCallback& callback);
+
// Explicit asynchronous creation of a profile located at |profile_path|.
// If the profile has already been created then callback is called
// immediately. Should be called on the UI thread.
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_impl.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698