OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/ui/webui/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 CallJS("login.AccountPickerScreen.showUserPodCustomIcon", | 941 CallJS("login.AccountPickerScreen.showUserPodCustomIcon", |
942 username, icon_representations); | 942 username, icon_representations); |
943 | 943 |
944 // TODO(tengs): Move this code once we move unlocking to native code. | 944 // TODO(tengs): Move this code once we move unlocking to native code. |
945 if (ScreenLocker::default_screen_locker()) { | 945 if (ScreenLocker::default_screen_locker()) { |
946 UserManager* user_manager = UserManager::Get(); | 946 UserManager* user_manager = UserManager::Get(); |
947 const user_manager::User* user = user_manager->FindUser(username); | 947 const user_manager::User* user = user_manager->FindUser(username); |
948 if (!user) | 948 if (!user) |
949 return; | 949 return; |
950 PrefService* profile_prefs = | 950 PrefService* profile_prefs = |
951 ProfileHelper::Get()->GetProfileByUser(user)->GetPrefs(); | 951 ProfileHelper::Get()->GetProfileByUserUnsafe(user)->GetPrefs(); |
952 if (profile_prefs->GetBoolean(prefs::kEasyUnlockShowTutorial)) { | 952 if (profile_prefs->GetBoolean(prefs::kEasyUnlockShowTutorial)) { |
953 CallJS("login.AccountPickerScreen.showEasyUnlockBubble"); | 953 CallJS("login.AccountPickerScreen.showEasyUnlockBubble"); |
954 profile_prefs->SetBoolean(prefs::kEasyUnlockShowTutorial, false); | 954 profile_prefs->SetBoolean(prefs::kEasyUnlockShowTutorial, false); |
955 } | 955 } |
956 } | 956 } |
957 } | 957 } |
958 | 958 |
959 void SigninScreenHandler::HideUserPodCustomIcon(const std::string& username) { | 959 void SigninScreenHandler::HideUserPodCustomIcon(const std::string& username) { |
960 CallJS("login.AccountPickerScreen.hideUserPodCustomIcon", username); | 960 CallJS("login.AccountPickerScreen.hideUserPodCustomIcon", username); |
961 } | 961 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 it != users.end(); | 1055 it != users.end(); |
1056 ++it) { | 1056 ++it) { |
1057 if ((*it)->email() == username) { | 1057 if ((*it)->email() == username) { |
1058 unlock_user = *it; | 1058 unlock_user = *it; |
1059 break; | 1059 break; |
1060 } | 1060 } |
1061 } | 1061 } |
1062 if (!unlock_user) | 1062 if (!unlock_user) |
1063 return; | 1063 return; |
1064 | 1064 |
1065 Profile* profile = ProfileHelper::Get()->GetProfileByUser(unlock_user); | 1065 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(unlock_user); |
1066 extensions::ScreenlockPrivateEventRouter* router = | 1066 extensions::ScreenlockPrivateEventRouter* router = |
1067 extensions::ScreenlockPrivateEventRouter::GetFactoryInstance()->Get( | 1067 extensions::ScreenlockPrivateEventRouter::GetFactoryInstance()->Get( |
1068 profile); | 1068 profile); |
1069 router->OnAuthAttempted(GetAuthType(username), ""); | 1069 router->OnAuthAttempted(GetAuthType(username), ""); |
1070 } | 1070 } |
1071 | 1071 |
1072 void SigninScreenHandler::HandleLaunchDemoUser() { | 1072 void SigninScreenHandler::HandleLaunchDemoUser() { |
1073 UserContext context(user_manager::USER_TYPE_RETAIL_MODE, std::string()); | 1073 UserContext context(user_manager::USER_TYPE_RETAIL_MODE, std::string()); |
1074 if (delegate_) | 1074 if (delegate_) |
1075 delegate_->Login(context, SigninSpecifics()); | 1075 delegate_->Login(context, SigninSpecifics()); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 return gaia_screen_handler_->frame_error(); | 1491 return gaia_screen_handler_->frame_error(); |
1492 } | 1492 } |
1493 | 1493 |
1494 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1494 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1495 caps_lock_enabled_ = enabled; | 1495 caps_lock_enabled_ = enabled; |
1496 if (page_is_ready()) | 1496 if (page_is_ready()) |
1497 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1497 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1498 } | 1498 } |
1499 | 1499 |
1500 } // namespace chromeos | 1500 } // namespace chromeos |
OLD | NEW |