| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 | 1648 |
| 1649 Profile* profile = ProfileHelper::Get()->GetProfileByUser(active_user); | 1649 Profile* profile = ProfileHelper::Get()->GetProfileByUser(active_user); |
| 1650 // If profile has not yet been initialized, delay initialization of IME. | 1650 // If profile has not yet been initialized, delay initialization of IME. |
| 1651 if (!profile) | 1651 if (!profile) |
| 1652 return; | 1652 return; |
| 1653 | 1653 |
| 1654 input_method::InputMethodManager* manager = | 1654 input_method::InputMethodManager* manager = |
| 1655 input_method::InputMethodManager::Get(); | 1655 input_method::InputMethodManager::Get(); |
| 1656 manager->SetState( | 1656 manager->SetState( |
| 1657 GetDefaultIMEState(ProfileHelper::Get()->GetProfileByUser(active_user))); | 1657 GetDefaultIMEState(ProfileHelper::Get()->GetProfileByUser(active_user))); |
| 1658 manager->MaybeNotifyImeMenuActivationChanged(); |
| 1658 } | 1659 } |
| 1659 | 1660 |
| 1660 scoped_refptr<input_method::InputMethodManager::State> | 1661 scoped_refptr<input_method::InputMethodManager::State> |
| 1661 UserSessionManager::GetDefaultIMEState(Profile* profile) { | 1662 UserSessionManager::GetDefaultIMEState(Profile* profile) { |
| 1662 scoped_refptr<input_method::InputMethodManager::State> state = | 1663 scoped_refptr<input_method::InputMethodManager::State> state = |
| 1663 default_ime_states_[profile]; | 1664 default_ime_states_[profile]; |
| 1664 if (!state.get()) { | 1665 if (!state.get()) { |
| 1665 // Profile can be NULL in tests. | 1666 // Profile can be NULL in tests. |
| 1666 state = input_method::InputMethodManager::Get()->CreateNewState(profile); | 1667 state = input_method::InputMethodManager::Get()->CreateNewState(profile); |
| 1667 default_ime_states_[profile] = state; | 1668 default_ime_states_[profile] = state; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 ->browser_policy_connector_chromeos() | 1894 ->browser_policy_connector_chromeos() |
| 1894 ->IsEnterpriseManaged()) { | 1895 ->IsEnterpriseManaged()) { |
| 1895 return false; | 1896 return false; |
| 1896 } | 1897 } |
| 1897 | 1898 |
| 1898 // Do not show end of life notification if this is a guest session | 1899 // Do not show end of life notification if this is a guest session |
| 1899 return !profile->IsGuestSession(); | 1900 return !profile->IsGuestSession(); |
| 1900 } | 1901 } |
| 1901 | 1902 |
| 1902 } // namespace chromeos | 1903 } // namespace chromeos |
| OLD | NEW |