| 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/login_utils.h" | 9 #include "chrome/browser/chromeos/login/login_utils.h" |
| 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 11 #include "chrome/browser/signin/screenlock_bridge.h" | 11 #include "chrome/browser/signin/screenlock_bridge.h" |
| 12 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL; | 20 user_manager::UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL; |
| 21 | 21 |
| 22 AppLaunchSigninScreen::AppLaunchSigninScreen( | 22 AppLaunchSigninScreen::AppLaunchSigninScreen( |
| 23 OobeUI* oobe_ui, Delegate* delegate) | 23 OobeUI* oobe_ui, Delegate* delegate) |
| 24 : oobe_ui_(oobe_ui), | 24 : oobe_ui_(oobe_ui), |
| 25 delegate_(delegate), | 25 delegate_(delegate), |
| 26 webui_handler_(NULL) { | 26 webui_handler_(NULL) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 AppLaunchSigninScreen::~AppLaunchSigninScreen() { | 29 AppLaunchSigninScreen::~AppLaunchSigninScreen() { |
| 30 oobe_ui_->ResetSigninScreenHandlerDelegate(); | 30 oobe_ui_->ResetSigninScreenHandlerDelegate(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void AppLaunchSigninScreen::Show() { | 33 void AppLaunchSigninScreen::Show() { |
| 34 InitOwnerUserList(); | 34 InitOwnerUserList(); |
| 35 oobe_ui_->web_ui()->CallJavascriptFunction( | 35 oobe_ui_->web_ui()->CallJavascriptFunction( |
| 36 "login.AccountPickerScreen.setShouldShowApps", | 36 "login.AccountPickerScreen.setShouldShowApps", |
| 37 base::FundamentalValue(false)); | 37 base::FundamentalValue(false)); |
| 38 oobe_ui_->ShowSigninScreen(LoginScreenContext(), this, NULL); | 38 oobe_ui_->ShowSigninScreen(LoginScreenContext(), this, NULL); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void AppLaunchSigninScreen::InitOwnerUserList() { | 41 void AppLaunchSigninScreen::InitOwnerUserList() { |
| 42 UserManager* user_manager = GetUserManager(); | 42 user_manager::UserManager* user_manager = GetUserManager(); |
| 43 const std::string& owner_email = user_manager->GetOwnerEmail(); | 43 const std::string& owner_email = user_manager->GetOwnerEmail(); |
| 44 const user_manager::UserList& all_users = user_manager->GetUsers(); | 44 const user_manager::UserList& all_users = user_manager->GetUsers(); |
| 45 | 45 |
| 46 owner_user_list_.clear(); | 46 owner_user_list_.clear(); |
| 47 for (user_manager::UserList::const_iterator it = all_users.begin(); | 47 for (user_manager::UserList::const_iterator it = all_users.begin(); |
| 48 it != all_users.end(); | 48 it != all_users.end(); |
| 49 ++it) { | 49 ++it) { |
| 50 user_manager::User* user = *it; | 50 user_manager::User* user = *it; |
| 51 if (user->email() == owner_email) { | 51 if (user->email() == owner_email) { |
| 52 owner_user_list_.push_back(user); | 52 owner_user_list_.push_back(user); |
| 53 break; | 53 break; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 void AppLaunchSigninScreen::SetUserManagerForTesting( | 59 void AppLaunchSigninScreen::SetUserManagerForTesting( |
| 60 UserManager* user_manager) { | 60 user_manager::UserManager* user_manager) { |
| 61 test_user_manager_ = user_manager; | 61 test_user_manager_ = user_manager; |
| 62 } | 62 } |
| 63 | 63 |
| 64 UserManager* AppLaunchSigninScreen::GetUserManager() { | 64 user_manager::UserManager* AppLaunchSigninScreen::GetUserManager() { |
| 65 return test_user_manager_ ? test_user_manager_ : UserManager::Get(); | 65 return test_user_manager_ ? test_user_manager_ |
| 66 : user_manager::UserManager::Get(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 void AppLaunchSigninScreen::CancelPasswordChangedFlow() { | 69 void AppLaunchSigninScreen::CancelPasswordChangedFlow() { |
| 69 NOTREACHED(); | 70 NOTREACHED(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void AppLaunchSigninScreen::CancelUserAdding() { | 73 void AppLaunchSigninScreen::CancelUserAdding() { |
| 73 NOTREACHED(); | 74 NOTREACHED(); |
| 74 } | 75 } |
| 75 | 76 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ScreenlockBridge::LockHandler::AuthType auth_type) { | 218 ScreenlockBridge::LockHandler::AuthType auth_type) { |
| 218 return; | 219 return; |
| 219 } | 220 } |
| 220 | 221 |
| 221 ScreenlockBridge::LockHandler::AuthType AppLaunchSigninScreen::GetAuthType( | 222 ScreenlockBridge::LockHandler::AuthType AppLaunchSigninScreen::GetAuthType( |
| 222 const std::string& username) const { | 223 const std::string& username) const { |
| 223 return ScreenlockBridge::LockHandler::OFFLINE_PASSWORD; | 224 return ScreenlockBridge::LockHandler::OFFLINE_PASSWORD; |
| 224 } | 225 } |
| 225 | 226 |
| 226 } // namespace chromeos | 227 } // namespace chromeos |
| OLD | NEW |