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

Unified Diff: chrome/browser/chromeos/profiles/profile_helper.h

Issue 14581006: [cros mp] Load profiles from /home/chronos/u-[$hash], add GetUserIdHashFromProfile() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 7 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/chromeos/profiles/profile_helper.h
diff --git a/chrome/browser/chromeos/profiles/profile_helper.h b/chrome/browser/chromeos/profiles/profile_helper.h
index aa0a8d6427a551df0ca6c1a5b30edf0c76d1d941..19f6b857e5bbf0616538a7a535ee9f7606297d51 100644
--- a/chrome/browser/chromeos/profiles/profile_helper.h
+++ b/chrome/browser/chromeos/profiles/profile_helper.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/files/file_path.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
#include "chrome/browser/chromeos/login/user_manager.h"
@@ -20,6 +21,11 @@ namespace chromeos {
class ProfileHelper : public BrowsingDataRemover::Observer,
public UserManager::UserSessionStateObserver {
public:
+ // Chrome OS profile directories have custom prefix.
+ // Profile path format: [user_data_dir]/u-[$hash]
+ // Ex.: /home/chronos/u-0123456789
+ static const char kProfileDirPrefix[];
+
ProfileHelper();
virtual ~ProfileHelper();
@@ -29,6 +35,10 @@ class ProfileHelper : public BrowsingDataRemover::Observer,
// Returns OffTheRecord profile for use during signing phase.
static Profile* GetSigninProfile();
+ // Returns user_id hash for |profile| instance or empty string if hash
+ // could not be extracted from |profile|.
+ static std::string GetUserIdHashFromProfile(Profile* profile);
+
// Returns true if |profile| is the signin Profile. This can be used during
// construction of the signin Profile to determine if that Profile is the
// signin Profile.
@@ -38,6 +48,9 @@ class ProfileHelper : public BrowsingDataRemover::Observer,
// TODO(dzhioev): Investigate whether or not this method is needed.
static void ProfileStartup(Profile* profile, bool process_startup);
+ // Returns active user profile dir in a format [u-$hash].
+ base::FilePath GetActiveUserProfileDir();
+
// Should called once after UserManager instance has been created.
void Initialize();
@@ -50,6 +63,8 @@ class ProfileHelper : public BrowsingDataRemover::Observer,
void ClearSigninProfile(const base::Closure& on_clear_callback);
private:
+ friend class ProfileHelperTest;
+
// UserManager::UserSessionStateObserver implementation:
virtual void ActiveUserHashChanged(const std::string& hash) OVERRIDE;
« no previous file with comments | « chrome/browser/chromeos/extensions/networking_private_apitest.cc ('k') | chrome/browser/chromeos/profiles/profile_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698