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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 44 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
45 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | 45 #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
46 #include "chrome/browser/chromeos/policy/consumer_management_stage.h" | 46 #include "chrome/browser/chromeos/policy/consumer_management_stage.h" |
47 #include "chrome/browser/chromeos/policy/device_local_account.h" | 47 #include "chrome/browser/chromeos/policy/device_local_account.h" |
48 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 48 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
49 #include "chrome/browser/chromeos/settings/cros_settings.h" | 49 #include "chrome/browser/chromeos/settings/cros_settings.h" |
50 #include "chrome/browser/io_thread.h" | 50 #include "chrome/browser/io_thread.h" |
51 #include "chrome/browser/profiles/profile.h" | 51 #include "chrome/browser/profiles/profile.h" |
52 #include "chrome/browser/profiles/profile_metrics.h" | 52 #include "chrome/browser/profiles/profile_metrics.h" |
53 #include "chrome/browser/signin/easy_unlock_service.h" | 53 #include "chrome/browser/signin/easy_unlock_service.h" |
| 54 #include "chrome/browser/signin/proximity_auth_facade.h" |
54 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 55 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
55 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 56 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
56 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 57 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
57 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 58 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
58 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 59 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
59 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 60 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
60 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
61 #include "chrome/common/url_constants.h" | 62 #include "chrome/common/url_constants.h" |
62 #include "chrome/grit/chromium_strings.h" | 63 #include "chrome/grit/chromium_strings.h" |
63 #include "chrome/grit/generated_resources.h" | 64 #include "chrome/grit/generated_resources.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 if (keyboard) | 288 if (keyboard) |
288 keyboard->RemoveObserver(this); | 289 keyboard->RemoveObserver(this); |
289 weak_factory_.InvalidateWeakPtrs(); | 290 weak_factory_.InvalidateWeakPtrs(); |
290 if (delegate_) | 291 if (delegate_) |
291 delegate_->SetWebUIHandler(NULL); | 292 delegate_->SetWebUIHandler(NULL); |
292 network_state_informer_->RemoveObserver(this); | 293 network_state_informer_->RemoveObserver(this); |
293 if (max_mode_delegate_) { | 294 if (max_mode_delegate_) { |
294 max_mode_delegate_->RemoveObserver(this); | 295 max_mode_delegate_->RemoveObserver(this); |
295 max_mode_delegate_.reset(NULL); | 296 max_mode_delegate_.reset(NULL); |
296 } | 297 } |
297 ScreenlockBridge::Get()->SetLockHandler(NULL); | 298 GetScreenlockBridgeInstance()->SetLockHandler(NULL); |
298 ScreenlockBridge::Get()->SetFocusedUser(""); | 299 GetScreenlockBridgeInstance()->SetFocusedUser(""); |
299 } | 300 } |
300 | 301 |
301 // static | 302 // static |
302 std::string SigninScreenHandler::GetUserLRUInputMethod( | 303 std::string SigninScreenHandler::GetUserLRUInputMethod( |
303 const std::string& username) { | 304 const std::string& username) { |
304 PrefService* const local_state = g_browser_process->local_state(); | 305 PrefService* const local_state = g_browser_process->local_state(); |
305 const base::DictionaryValue* users_lru_input_methods = | 306 const base::DictionaryValue* users_lru_input_methods = |
306 local_state->GetDictionary(prefs::kUsersLRUInputMethod); | 307 local_state->GetDictionary(prefs::kUsersLRUInputMethod); |
307 | 308 |
308 if (!users_lru_input_methods) { | 309 if (!users_lru_input_methods) { |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); | 1250 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); |
1250 } | 1251 } |
1251 | 1252 |
1252 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { | 1253 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { |
1253 offline_login_active_ = offline_login_active; | 1254 offline_login_active_ = offline_login_active; |
1254 } | 1255 } |
1255 | 1256 |
1256 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { | 1257 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { |
1257 SetUserInputMethod(user_id, ime_state_.get()); | 1258 SetUserInputMethod(user_id, ime_state_.get()); |
1258 WallpaperManager::Get()->SetUserWallpaperDelayed(user_id); | 1259 WallpaperManager::Get()->SetUserWallpaperDelayed(user_id); |
1259 ScreenlockBridge::Get()->SetFocusedUser(user_id); | 1260 GetScreenlockBridgeInstance()->SetFocusedUser(user_id); |
1260 if (delegate_) | 1261 if (delegate_) |
1261 delegate_->CheckUserStatus(user_id); | 1262 delegate_->CheckUserStatus(user_id); |
1262 if (!test_focus_pod_callback_.is_null()) | 1263 if (!test_focus_pod_callback_.is_null()) |
1263 test_focus_pod_callback_.Run(); | 1264 test_focus_pod_callback_.Run(); |
1264 } | 1265 } |
1265 | 1266 |
1266 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( | 1267 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( |
1267 const std::string& user_id, | 1268 const std::string& user_id, |
1268 const std::string& locale) { | 1269 const std::string& locale) { |
1269 GetKeyboardLayoutsForLocale( | 1270 GetKeyboardLayoutsForLocale( |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 return gaia_screen_handler_->frame_error(); | 1407 return gaia_screen_handler_->frame_error(); |
1407 } | 1408 } |
1408 | 1409 |
1409 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1410 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1410 caps_lock_enabled_ = enabled; | 1411 caps_lock_enabled_ = enabled; |
1411 if (page_is_ready()) | 1412 if (page_is_ready()) |
1412 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1413 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1413 } | 1414 } |
1414 | 1415 |
1415 } // namespace chromeos | 1416 } // namespace chromeos |
OLD | NEW |