| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 43 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 44 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | 44 #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
| 45 #include "chrome/browser/chromeos/policy/consumer_management_stage.h" | 45 #include "chrome/browser/chromeos/policy/consumer_management_stage.h" |
| 46 #include "chrome/browser/chromeos/policy/device_local_account.h" | 46 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 47 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 47 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 48 #include "chrome/browser/chromeos/settings/cros_settings.h" | 48 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 49 #include "chrome/browser/io_thread.h" | 49 #include "chrome/browser/io_thread.h" |
| 50 #include "chrome/browser/profiles/profile.h" | 50 #include "chrome/browser/profiles/profile.h" |
| 51 #include "chrome/browser/profiles/profile_metrics.h" | 51 #include "chrome/browser/profiles/profile_metrics.h" |
| 52 #include "chrome/browser/signin/easy_unlock_service.h" | 52 #include "chrome/browser/signin/easy_unlock_service.h" |
| 53 #include "chrome/browser/signin/easy_unlock_util.h" |
| 53 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 54 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
| 54 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 55 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 55 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 56 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
| 56 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 57 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
| 57 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 58 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 58 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 59 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 59 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
| 60 #include "chrome/common/url_constants.h" | 61 #include "chrome/common/url_constants.h" |
| 61 #include "chrome/grit/chromium_strings.h" | 62 #include "chrome/grit/chromium_strings.h" |
| 62 #include "chrome/grit/generated_resources.h" | 63 #include "chrome/grit/generated_resources.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 if (keyboard) | 287 if (keyboard) |
| 287 keyboard->RemoveObserver(this); | 288 keyboard->RemoveObserver(this); |
| 288 weak_factory_.InvalidateWeakPtrs(); | 289 weak_factory_.InvalidateWeakPtrs(); |
| 289 if (delegate_) | 290 if (delegate_) |
| 290 delegate_->SetWebUIHandler(NULL); | 291 delegate_->SetWebUIHandler(NULL); |
| 291 network_state_informer_->RemoveObserver(this); | 292 network_state_informer_->RemoveObserver(this); |
| 292 if (max_mode_delegate_) { | 293 if (max_mode_delegate_) { |
| 293 max_mode_delegate_->RemoveObserver(this); | 294 max_mode_delegate_->RemoveObserver(this); |
| 294 max_mode_delegate_.reset(NULL); | 295 max_mode_delegate_.reset(NULL); |
| 295 } | 296 } |
| 296 ScreenlockBridge::Get()->SetLockHandler(NULL); | 297 GetScreenlockBridgeInstance()->SetLockHandler(NULL); |
| 297 ScreenlockBridge::Get()->SetFocusedUser(""); | 298 GetScreenlockBridgeInstance()->SetFocusedUser(""); |
| 298 } | 299 } |
| 299 | 300 |
| 300 // static | 301 // static |
| 301 std::string SigninScreenHandler::GetUserLRUInputMethod( | 302 std::string SigninScreenHandler::GetUserLRUInputMethod( |
| 302 const std::string& username) { | 303 const std::string& username) { |
| 303 PrefService* const local_state = g_browser_process->local_state(); | 304 PrefService* const local_state = g_browser_process->local_state(); |
| 304 const base::DictionaryValue* users_lru_input_methods = | 305 const base::DictionaryValue* users_lru_input_methods = |
| 305 local_state->GetDictionary(prefs::kUsersLRUInputMethod); | 306 local_state->GetDictionary(prefs::kUsersLRUInputMethod); |
| 306 | 307 |
| 307 if (!users_lru_input_methods) { | 308 if (!users_lru_input_methods) { |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); | 1238 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); |
| 1238 } | 1239 } |
| 1239 | 1240 |
| 1240 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { | 1241 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { |
| 1241 offline_login_active_ = offline_login_active; | 1242 offline_login_active_ = offline_login_active; |
| 1242 } | 1243 } |
| 1243 | 1244 |
| 1244 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { | 1245 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { |
| 1245 SetUserInputMethod(user_id, ime_state_.get()); | 1246 SetUserInputMethod(user_id, ime_state_.get()); |
| 1246 WallpaperManager::Get()->SetUserWallpaperDelayed(user_id); | 1247 WallpaperManager::Get()->SetUserWallpaperDelayed(user_id); |
| 1247 ScreenlockBridge::Get()->SetFocusedUser(user_id); | 1248 GetScreenlockBridgeInstance()->SetFocusedUser(user_id); |
| 1248 if (delegate_) | 1249 if (delegate_) |
| 1249 delegate_->CheckUserStatus(user_id); | 1250 delegate_->CheckUserStatus(user_id); |
| 1250 if (!test_focus_pod_callback_.is_null()) | 1251 if (!test_focus_pod_callback_.is_null()) |
| 1251 test_focus_pod_callback_.Run(); | 1252 test_focus_pod_callback_.Run(); |
| 1252 } | 1253 } |
| 1253 | 1254 |
| 1254 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( | 1255 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( |
| 1255 const std::string& user_id, | 1256 const std::string& user_id, |
| 1256 const std::string& locale) { | 1257 const std::string& locale) { |
| 1257 GetKeyboardLayoutsForLocale( | 1258 GetKeyboardLayoutsForLocale( |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 return gaia_screen_handler_->frame_error(); | 1395 return gaia_screen_handler_->frame_error(); |
| 1395 } | 1396 } |
| 1396 | 1397 |
| 1397 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1398 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
| 1398 caps_lock_enabled_ = enabled; | 1399 caps_lock_enabled_ = enabled; |
| 1399 if (page_is_ready()) | 1400 if (page_is_ready()) |
| 1400 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1401 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
| 1401 } | 1402 } |
| 1402 | 1403 |
| 1403 } // namespace chromeos | 1404 } // namespace chromeos |
| OLD | NEW |