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

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

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.h ('k') | chrome/browser/extensions/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/profiles/profile_helper.cc
diff --git a/chrome/browser/chromeos/profiles/profile_helper.cc b/chrome/browser/chromeos/profiles/profile_helper.cc
index 5bc7736b5b63f2d949bdc4add2f21bcdfbaaca26..bd4bb1b7a71b4c589cb8db07595f5d9c28d58b0f 100644
--- a/chrome/browser/chromeos/profiles/profile_helper.cc
+++ b/chrome/browser/chromeos/profiles/profile_helper.cc
@@ -42,6 +42,9 @@ namespace {
// As defined in /chromeos/dbus/cryptohome_client.cc.
static const char kUserIdHashSuffix[] = "-hash";
+// The name for the lock screen app profile.
+static const char kLockScreenAppProfile[] = "LockScreenAppsProfile";
+
bool ShouldAddProfileDirPrefix(const std::string& user_id_hash) {
// Do not add profile dir prefix for legacy profile dir and test
// user profile. The reason of not adding prefix for test user profile
@@ -170,6 +173,23 @@ bool ProfileHelper::IsSigninProfile(const Profile* profile) {
profile->GetPath().BaseName().value() == chrome::kInitialProfile;
}
+// static
+bool ProfileHelper::IsLockScreenAppProfile(const Profile* profile) {
+ return profile &&
+ profile->GetPath().BaseName().value() == kLockScreenAppProfile;
+}
+
+// static
+base::FilePath ProfileHelper::GetLockScreenAppProfilePath() {
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ return profile_manager->user_data_dir().AppendASCII(kLockScreenAppProfile);
+}
+
+// static
+std::string ProfileHelper::GetLockScreenAppProfileName() {
+ return kLockScreenAppProfile;
+}
+
// static
bool ProfileHelper::IsOwnerProfile(const Profile* profile) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -358,8 +378,10 @@ const user_manager::User* ProfileHelper::GetUserByProfile(
DCHECK(!content::BrowserThread::IsThreadInitialized(
content::BrowserThread::UI) ||
content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- if (ProfileHelper::IsSigninProfile(profile))
- return NULL;
+ if (ProfileHelper::IsSigninProfile(profile) ||
+ ProfileHelper::IsLockScreenAppProfile(profile)) {
+ return nullptr;
+ }
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.h ('k') | chrome/browser/extensions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698