Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/terms_of_service_screen_handler .h" 5 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler .h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 user_manager::UserManager::Get()->GetActiveUser()) 158 user_manager::UserManager::Get()->GetActiveUser())
159 ->GetPrefs() 159 ->GetPrefs()
160 ->GetString(prefs::kLanguagePreloadEngines), 160 ->GetString(prefs::kLanguagePreloadEngines),
161 ',', 161 ',',
162 &input_methods); 162 &input_methods);
163 163
164 if (!input_methods.empty()) { 164 if (!input_methods.empty()) {
165 // If the user has a preferred input method, enable it and switch to it. 165 // If the user has a preferred input method, enable it and switch to it.
166 chromeos::input_method::InputMethodManager* input_method_manager = 166 chromeos::input_method::InputMethodManager* input_method_manager =
167 chromeos::input_method::InputMethodManager::Get(); 167 chromeos::input_method::InputMethodManager::Get();
168 input_method_manager->EnableInputMethod(input_methods.front()); 168 input_method_manager->GetActiveIMEState()->EnableInputMethod(
169 input_method_manager->ChangeInputMethod(input_methods.front()); 169 input_methods.front());
170 input_method_manager->GetActiveIMEState()->ChangeInputMethod(
171 input_methods.front(), false /* show_message */);
170 } 172 }
171 173
172 // Updates the domain name shown in the UI. 174 // Updates the domain name shown in the UI.
173 UpdateDomainInUI(); 175 UpdateDomainInUI();
174 176
175 // Update the UI to show an error message or the Terms of Service. 177 // Update the UI to show an error message or the Terms of Service.
176 UpdateTermsOfServiceInUI(); 178 UpdateTermsOfServiceInUI();
177 179
178 ShowScreen(OobeUI::kScreenTermsOfService, NULL); 180 ShowScreen(OobeUI::kScreenTermsOfService, NULL);
179 } 181 }
(...skipping 30 matching lines...) Expand all
210 // and continue" button should not be accessible. If the user managed to 212 // and continue" button should not be accessible. If the user managed to
211 // activate it somehow anway, do not treat this as acceptance of the Terms 213 // activate it somehow anway, do not treat this as acceptance of the Terms
212 // and Conditions and end the session instead, as if the user had declined. 214 // and Conditions and end the session instead, as if the user had declined.
213 if (terms_of_service_.empty()) 215 if (terms_of_service_.empty())
214 screen_->OnDecline(); 216 screen_->OnDecline();
215 else 217 else
216 screen_->OnAccept(); 218 screen_->OnAccept();
217 } 219 }
218 220
219 } // namespace chromeos 221 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698