Index: chrome/browser/chromeos/login/user_manager.cc |
diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc |
index b9f82e7302dddf7053eba3cdff23efbab0a07d2d..db094e77767d2ffcbb64b981d32c22d9a3fba97c 100644 |
--- a/chrome/browser/chromeos/login/user_manager.cc |
+++ b/chrome/browser/chromeos/login/user_manager.cc |
@@ -5,7 +5,10 @@ |
#include "chrome/browser/chromeos/login/user_manager.h" |
#include "base/logging.h" |
+#include "base/string_util.h" |
bartfab (slow)
2013/04/25 11:17:28
Nit: Not used.
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Done.
|
#include "chrome/browser/chromeos/login/user_manager_impl.h" |
+#include "chrome/common/extensions/extension.h" |
+#include "google_apis/gaia/gaia_auth_util.h" |
namespace chromeos { |
@@ -54,6 +57,27 @@ UserManager* UserManager::SetForTesting(UserManager* user_manager) { |
return previous_user_manager; |
} |
+// static |
+bool UserManager::ParseKioskAppUserId(const std::string& user_id, |
+ std::string* app_id) { |
+ if (gaia::ExtractDomainName(user_id) == kKioskAppUserDomain) { |
+ const std::string candidate_app_id( |
+ user_id.substr(0, user_id.size() - arraysize(kKioskAppUserDomain))); |
bartfab (slow)
2013/04/25 11:17:28
Will that not leave a dangling "@" at the end of |
xiyuan
2013/04/25 17:26:32
I had the same question when looking at this. Then
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Obsolete
|
+ if (extensions::Extension::IdIsValid(candidate_app_id)) { |
bartfab (slow)
2013/04/25 11:17:28
Since you are explicitly storing the app ID in a d
xiyuan
2013/04/25 17:26:32
I don't see the the benefit of using an opaque ide
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Obsolete
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Some background from an offline discussion I had w
|
+ *app_id = candidate_app_id; |
+ return true; |
+ } |
+ } |
+ |
+ return false; |
+} |
+ |
+// static |
+std::string UserManager::FormatKioskAppUserId(const std::string& app_id) { |
+ DCHECK(extensions::Extension::IdIsValid(app_id)); |
bartfab (slow)
2013/04/25 11:17:28
Same as above: Why does the local part need to be
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Obsolete
|
+ return app_id + '@' + kKioskAppUserDomain; |
+} |
+ |
ScopedUserManagerEnabler::ScopedUserManagerEnabler(UserManager* user_manager) |
: previous_user_manager_(UserManager::SetForTesting(user_manager)) { |
} |