OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 input_method::InputMethodManager* manager = | 1001 input_method::InputMethodManager* manager = |
1002 input_method::InputMethodManager::Get(); | 1002 input_method::InputMethodManager::Get(); |
1003 manager->SetState( | 1003 manager->SetState( |
1004 GetDefaultIMEState(ProfileHelper::Get()->GetProfileByUser(active_user))); | 1004 GetDefaultIMEState(ProfileHelper::Get()->GetProfileByUser(active_user))); |
1005 } | 1005 } |
1006 | 1006 |
1007 scoped_refptr<input_method::InputMethodManager::State> | 1007 scoped_refptr<input_method::InputMethodManager::State> |
1008 UserSessionManager::GetDefaultIMEState(Profile* profile) { | 1008 UserSessionManager::GetDefaultIMEState(Profile* profile) { |
1009 scoped_refptr<input_method::InputMethodManager::State> state = | 1009 scoped_refptr<input_method::InputMethodManager::State> state = |
1010 default_ime_states_[profile]; | 1010 default_ime_states_[profile]; |
1011 if (!state) { | 1011 if (!state.get()) { |
1012 // Profile can be NULL in tests. | 1012 // Profile can be NULL in tests. |
1013 state = input_method::InputMethodManager::Get()->CreateNewState(profile); | 1013 state = input_method::InputMethodManager::Get()->CreateNewState(profile); |
1014 default_ime_states_[profile] = state; | 1014 default_ime_states_[profile] = state; |
1015 } | 1015 } |
1016 return state; | 1016 return state; |
1017 } | 1017 } |
1018 | 1018 |
1019 } // namespace chromeos | 1019 } // namespace chromeos |
OLD | NEW |