OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 saved_active_input_method_list_.push_back(input_method_id); | 102 saved_active_input_method_list_.push_back(input_method_id); |
103 // |active_input_method_list| contains both input method descriptions | 103 // |active_input_method_list| contains both input method descriptions |
104 // and keyboard layout descriptions. | 104 // and keyboard layout descriptions. |
105 if (!StartsWithASCII(input_method_id, kValidInputMethodPrefix, true)) | 105 if (!StartsWithASCII(input_method_id, kValidInputMethodPrefix, true)) |
106 continue; | 106 continue; |
107 value.string_list_value.push_back(input_method_id); | 107 value.string_list_value.push_back(input_method_id); |
108 } | 108 } |
109 if (value.string_list_value.empty()) { | 109 if (value.string_list_value.empty()) { |
110 value.string_list_value.push_back(kFallbackInputMethodId); // US qwerty | 110 value.string_list_value.push_back(kFallbackInputMethodId); // US qwerty |
111 } | 111 } |
112 language->SetImeConfig(chromeos::kGeneralSectionName, | 112 language->SetImeConfig( |
113 chromeos::kPreloadEnginesConfigName, | 113 chromeos::language_prefs::kGeneralSectionName, |
114 value); | 114 chromeos::language_prefs::kPreloadEnginesConfigName, |
| 115 value); |
115 } | 116 } |
116 } | 117 } |
117 | 118 |
118 void RestoreInputMethods() { | 119 void RestoreInputMethods() { |
119 if (chromeos::CrosLibrary::Get()->EnsureLoaded() && | 120 if (chromeos::CrosLibrary::Get()->EnsureLoaded() && |
120 !saved_active_input_method_list_.empty()) { | 121 !saved_active_input_method_list_.empty()) { |
121 chromeos::InputMethodLibrary* language = | 122 chromeos::InputMethodLibrary* language = |
122 chromeos::CrosLibrary::Get()->GetInputMethodLibrary(); | 123 chromeos::CrosLibrary::Get()->GetInputMethodLibrary(); |
123 | 124 |
124 chromeos::ImeConfigValue value; | 125 chromeos::ImeConfigValue value; |
125 value.type = chromeos::ImeConfigValue::kValueTypeStringList; | 126 value.type = chromeos::ImeConfigValue::kValueTypeStringList; |
126 value.string_list_value = saved_active_input_method_list_; | 127 value.string_list_value = saved_active_input_method_list_; |
127 language->SetImeConfig(chromeos::kGeneralSectionName, | 128 language->SetImeConfig( |
128 chromeos::kPreloadEnginesConfigName, | 129 chromeos::language_prefs::kGeneralSectionName, |
129 value); | 130 chromeos::language_prefs::kPreloadEnginesConfigName, |
| 131 value); |
130 // Send previous input method id first so Ctrl+space would work fine. | 132 // Send previous input method id first so Ctrl+space would work fine. |
131 if (!saved_previous_input_method_id_.empty()) | 133 if (!saved_previous_input_method_id_.empty()) |
132 language->ChangeInputMethod(saved_previous_input_method_id_); | 134 language->ChangeInputMethod(saved_previous_input_method_id_); |
133 if (!saved_current_input_method_id_.empty()) | 135 if (!saved_current_input_method_id_.empty()) |
134 language->ChangeInputMethod(saved_current_input_method_id_); | 136 language->ChangeInputMethod(saved_current_input_method_id_); |
135 | 137 |
136 saved_previous_input_method_id_.clear(); | 138 saved_previous_input_method_id_.clear(); |
137 saved_current_input_method_id_.clear(); | 139 saved_current_input_method_id_.clear(); |
138 saved_active_input_method_list_.clear(); | 140 saved_active_input_method_list_.clear(); |
139 } | 141 } |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 697 } |
696 | 698 |
697 void ScreenLocker::OnWindowManagerReady() { | 699 void ScreenLocker::OnWindowManagerReady() { |
698 DLOG(INFO) << "OnClientEvent: drawn for lock"; | 700 DLOG(INFO) << "OnClientEvent: drawn for lock"; |
699 drawn_ = true; | 701 drawn_ = true; |
700 if (input_grabbed_) | 702 if (input_grabbed_) |
701 ScreenLockReady(); | 703 ScreenLockReady(); |
702 } | 704 } |
703 | 705 |
704 } // namespace chromeos | 706 } // namespace chromeos |
OLD | NEW |