Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / chromeos / login / ui / user_adding_screen_input_methods_controller.cc
blob343465d000b6b5238a4e265327b3e8a1ebef6aa6
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/ui/user_adding_screen_input_methods_controller.h"
7 #include "components/user_manager/user_manager.h"
9 namespace chromeos {
11 UserAddingScreenInputMethodsController::UserAddingScreenInputMethodsController(
12 UserAddingScreen* screen)
13 : screen_(screen), active_user_on_show_(NULL) {
14 screen_->AddObserver(this);
17 UserAddingScreenInputMethodsController::
18 ~UserAddingScreenInputMethodsController() {
19 screen_->RemoveObserver(this);
22 void UserAddingScreenInputMethodsController::OnUserAddingStarted() {
23 active_user_on_show_ = user_manager::UserManager::Get()->GetActiveUser();
24 input_method::InputMethodManager* imm =
25 input_method::InputMethodManager::Get();
26 saved_ime_state_ = imm->GetActiveIMEState();
27 imm->SetState(saved_ime_state_->Clone());
28 imm->GetActiveIMEState()->EnableLockScreenLayouts();
31 void UserAddingScreenInputMethodsController::OnUserAddingFinished() {
32 if (user_manager::UserManager::Get()->GetActiveUser() == active_user_on_show_)
33 input_method::InputMethodManager::Get()->SetState(saved_ime_state_);
35 saved_ime_state_ = NULL;
38 } // namespace chromeos