summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 17:32:01 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 17:32:01 +0000
commit9fd509ed3522ce50a8fc3dafef3fb253d3cfbb89 (patch)
tree6159a3d1cab3bcdb5a4d9d5df556f7436e6fa50d
parent27d8d91b471f30a93af37490e4bac20bb114cb1c (diff)
downloadchromium_src-9fd509ed3522ce50a8fc3dafef3fb253d3cfbb89.zip
chromium_src-9fd509ed3522ce50a8fc3dafef3fb253d3cfbb89.tar.gz
chromium_src-9fd509ed3522ce50a8fc3dafef3fb253d3cfbb89.tar.bz2
Fixed one CamelCapsCase: A profile name will contain the "display email name" not the user_id.
BUG=306174 TEST=visual Review URL: https://codereview.chromium.org/27051003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228361 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/ash/multi_user_window_manager.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/ui/ash/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user_window_manager.cc
index b1ae182..104de18 100644
--- a/chrome/browser/ui/ash/multi_user_window_manager.cc
+++ b/chrome/browser/ui/ash/multi_user_window_manager.cc
@@ -21,12 +21,20 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "content/public/browser/notification_service.h"
+#include "google_apis/gaia/gaia_auth_util.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
namespace {
chrome::MultiUserWindowManager* g_instance = NULL;
+
+// Get the user id from a given profile.
+std::string GetUserIDFromProfile(Profile* profile) {
+ return gaia::CanonicalizeEmail(gaia::SanitizeEmail(
+ profile->GetOriginalProfile()->GetProfileName()));
+}
+
} // namespace
namespace chrome {
@@ -64,7 +72,7 @@ MultiUserWindowManager* MultiUserWindowManager::GetInstance() {
ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled() &&
!ash::switches::UseFullMultiProfileMode()) {
g_instance = CreateInstanceInternal(
- ProfileManager::GetDefaultProfile()->GetProfileName());
+ GetUserIDFromProfile(ProfileManager::GetDefaultProfile()));
}
return g_instance;
}
@@ -313,7 +321,7 @@ void MultiUserWindowManager::AddBrowserWindow(Browser* browser) {
if (browser->window() && !browser->window()->GetNativeWindow())
return;
SetWindowOwner(browser->window()->GetNativeWindow(),
- browser->profile()->GetOriginalProfile()->GetProfileName());
+ GetUserIDFromProfile(browser->profile()));
}
void MultiUserWindowManager::SetWindowVisibility(
@@ -342,7 +350,7 @@ Profile* MultiUserWindowManager::GetProfileFromUserID(
std::vector<Profile*>::iterator profile_iterator = profiles.begin();
for (; profile_iterator != profiles.end(); ++profile_iterator) {
- if ((*profile_iterator)->GetProfileName() == user_id)
+ if (GetUserIDFromProfile(*profile_iterator) == user_id)
return *profile_iterator;
}
return NULL;