Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/app_launch_signin_screen.h" | 5 #include "chrome/browser/chromeos/login/app_launch_signin_screen.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 8 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
| 9 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 9 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 10 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 10 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 void AppLaunchSigninScreen::Show() { | 35 void AppLaunchSigninScreen::Show() { |
| 36 InitOwnerUserList(); | 36 InitOwnerUserList(); |
| 37 oobe_ui_->web_ui()->CallJavascriptFunction( | 37 oobe_ui_->web_ui()->CallJavascriptFunction( |
| 38 "login.AccountPickerScreen.setShouldShowApps", | 38 "login.AccountPickerScreen.setShouldShowApps", |
| 39 base::FundamentalValue(false)); | 39 base::FundamentalValue(false)); |
| 40 oobe_ui_->ShowSigninScreen(LoginScreenContext(), this, NULL); | 40 oobe_ui_->ShowSigninScreen(LoginScreenContext(), this, NULL); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void AppLaunchSigninScreen::InitOwnerUserList() { | 43 void AppLaunchSigninScreen::InitOwnerUserList() { |
| 44 user_manager::UserManager* user_manager = GetUserManager(); | 44 user_manager::UserManager* user_manager = GetUserManager(); |
| 45 const std::string& owner_email = user_manager->GetOwnerEmail(); | 45 const user_manager::UserID& owner_id = user_manager->GetOwnerID(); |
| 46 const user_manager::UserList& all_users = user_manager->GetUsers(); | 46 const user_manager::UserList& all_users = user_manager->GetUsers(); |
| 47 | 47 |
| 48 owner_user_list_.clear(); | 48 owner_user_list_.clear(); |
| 49 for (user_manager::UserList::const_iterator it = all_users.begin(); | 49 for (user_manager::UserList::const_iterator it = all_users.begin(); |
| 50 it != all_users.end(); | 50 it != all_users.end(); |
| 51 ++it) { | 51 ++it) { |
| 52 user_manager::User* user = *it; | 52 user_manager::User* user = *it; |
| 53 if (user->email() == owner_email) { | 53 if (user->GetUserID() == owner_id) { |
|
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:46
We should think about == contract for UserID, like
| |
| 54 owner_user_list_.push_back(user); | 54 owner_user_list_.push_back(user); |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 void AppLaunchSigninScreen::SetUserManagerForTesting( | 61 void AppLaunchSigninScreen::SetUserManagerForTesting( |
| 62 user_manager::UserManager* user_manager) { | 62 user_manager::UserManager* user_manager) { |
| 63 test_user_manager_ = user_manager; | 63 test_user_manager_ = user_manager; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 93 content::BrowserThread::UI, FROM_HERE, | 93 content::BrowserThread::UI, FROM_HERE, |
| 94 base::Bind(&Authenticator::AuthenticateToUnlock, | 94 base::Bind(&Authenticator::AuthenticateToUnlock, |
| 95 authenticator_.get(), | 95 authenticator_.get(), |
| 96 user_context)); | 96 user_context)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void AppLaunchSigninScreen::MigrateUserData(const std::string& old_password) { | 99 void AppLaunchSigninScreen::MigrateUserData(const std::string& old_password) { |
| 100 NOTREACHED(); | 100 NOTREACHED(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void AppLaunchSigninScreen::LoadWallpaper(const std::string& username) { | 103 void AppLaunchSigninScreen::LoadWallpaper(const user_manager::UserID& user_id) { |
| 104 } | 104 } |
| 105 | 105 |
| 106 void AppLaunchSigninScreen::LoadSigninWallpaper() { | 106 void AppLaunchSigninScreen::LoadSigninWallpaper() { |
| 107 } | 107 } |
| 108 | 108 |
| 109 void AppLaunchSigninScreen::OnSigninScreenReady() { | 109 void AppLaunchSigninScreen::OnSigninScreenReady() { |
| 110 } | 110 } |
| 111 | 111 |
| 112 void AppLaunchSigninScreen::RemoveUser(const std::string& username) { | 112 void AppLaunchSigninScreen::RemoveUser(const user_manager::UserID& user_id) { |
| 113 NOTREACHED(); | 113 NOTREACHED(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void AppLaunchSigninScreen::ResyncUserData() { | 116 void AppLaunchSigninScreen::ResyncUserData() { |
| 117 NOTREACHED(); | 117 NOTREACHED(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void AppLaunchSigninScreen::ShowEnterpriseEnrollmentScreen() { | 120 void AppLaunchSigninScreen::ShowEnterpriseEnrollmentScreen() { |
| 121 NOTREACHED(); | 121 NOTREACHED(); |
| 122 } | 122 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 136 void AppLaunchSigninScreen::ShowWrongHWIDScreen() { | 136 void AppLaunchSigninScreen::ShowWrongHWIDScreen() { |
| 137 NOTREACHED(); | 137 NOTREACHED(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void AppLaunchSigninScreen::SetWebUIHandler( | 140 void AppLaunchSigninScreen::SetWebUIHandler( |
| 141 LoginDisplayWebUIHandler* webui_handler) { | 141 LoginDisplayWebUIHandler* webui_handler) { |
| 142 webui_handler_ = webui_handler; | 142 webui_handler_ = webui_handler; |
| 143 } | 143 } |
| 144 | 144 |
| 145 void AppLaunchSigninScreen::ShowSigninScreenForCreds( | 145 void AppLaunchSigninScreen::ShowSigninScreenForCreds( |
| 146 const std::string& username, | 146 const user_manager::UserID& user_id, |
| 147 const std::string& password) { | 147 const std::string& password) { |
| 148 NOTREACHED(); | 148 NOTREACHED(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 const user_manager::UserList& AppLaunchSigninScreen::GetUsers() const { | 151 const user_manager::UserList& AppLaunchSigninScreen::GetUsers() const { |
| 152 if (test_user_manager_) { | 152 if (test_user_manager_) { |
| 153 return test_user_manager_->GetUsers(); | 153 return test_user_manager_->GetUsers(); |
| 154 } | 154 } |
| 155 return owner_user_list_; | 155 return owner_user_list_; |
| 156 } | 156 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 false, /* is_signin_to_add */ | 210 false, /* is_signin_to_add */ |
| 211 initial_auth_type, | 211 initial_auth_type, |
| 212 NULL, /* public_session_recommended_locales */ | 212 NULL, /* public_session_recommended_locales */ |
| 213 user_dict); | 213 user_dict); |
| 214 users_list.Append(user_dict); | 214 users_list.Append(user_dict); |
| 215 } | 215 } |
| 216 | 216 |
| 217 webui_handler_->LoadUsers(users_list, false); | 217 webui_handler_->LoadUsers(users_list, false); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void AppLaunchSigninScreen::CheckUserStatus(const std::string& user_id) { | 220 void AppLaunchSigninScreen::CheckUserStatus(const user_manager::UserID& user_id) { |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace chromeos | 223 } // namespace chromeos |
| OLD | NEW |