| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/input_method/input_method_persistence.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_persistence.h" |
| 6 | 6 |
| 7 #include "base/chromeos/chromeos_version.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/sys_info.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 12 #include "chrome/browser/chromeos/language_preferences.h" | 12 #include "chrome/browser/chromeos/language_preferences.h" |
| 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 namespace input_method { | 19 namespace input_method { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 Profile* const profile = ProfileManager::GetDefaultProfile(); | 41 Profile* const profile = ProfileManager::GetDefaultProfile(); |
| 42 | 42 |
| 43 if (profile == NULL) | 43 if (profile == NULL) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 if (!manager->IsLoginKeyboard(input_method)) | 46 if (!manager->IsLoginKeyboard(input_method)) |
| 47 return; | 47 return; |
| 48 | 48 |
| 49 const std::string username = profile->GetProfileName(); | 49 const std::string username = profile->GetProfileName(); |
| 50 if (base::chromeos::IsRunningOnChromeOS() && !username.empty() && | 50 if (base::SysInfo::IsRunningOnChromeOS() && !username.empty() && |
| 51 !local_state->ReadOnly()) { | 51 !local_state->ReadOnly()) { |
| 52 bool update_succeed = false; | 52 bool update_succeed = false; |
| 53 { | 53 { |
| 54 // Updater may have side-effects, therefore we do not replace | 54 // Updater may have side-effects, therefore we do not replace |
| 55 // entry while updater exists. | 55 // entry while updater exists. |
| 56 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod); | 56 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod); |
| 57 base::DictionaryValue* const users_lru_input_methods = updater.Get(); | 57 base::DictionaryValue* const users_lru_input_methods = updater.Get(); |
| 58 if (users_lru_input_methods) { | 58 if (users_lru_input_methods) { |
| 59 users_lru_input_methods->SetStringWithoutPathExpansion(username, | 59 users_lru_input_methods->SetStringWithoutPathExpansion(username, |
| 60 input_method); | 60 input_method); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void InputMethodPersistence::InputMethodPropertyChanged( | 146 void InputMethodPersistence::InputMethodPropertyChanged( |
| 147 InputMethodManager* manager) {} | 147 InputMethodManager* manager) {} |
| 148 | 148 |
| 149 void InputMethodPersistence::OnSessionStateChange( | 149 void InputMethodPersistence::OnSessionStateChange( |
| 150 InputMethodManager::State new_state) { | 150 InputMethodManager::State new_state) { |
| 151 state_ = new_state; | 151 state_ = new_state; |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace input_method | 154 } // namespace input_method |
| 155 } // namespace chromeos | 155 } // namespace chromeos |
| OLD | NEW |