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

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: Cleanup. 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ProfileHelper::Get()->GetProfileByUser( 151 ProfileHelper::Get()->GetProfileByUser(
152 UserManager::Get()->GetActiveUser())->GetPrefs()->GetString( 152 UserManager::Get()->GetActiveUser())->GetPrefs()->GetString(
153 prefs::kLanguagePreloadEngines), 153 prefs::kLanguagePreloadEngines),
154 ',', 154 ',',
155 &input_methods); 155 &input_methods);
156 156
157 if (!input_methods.empty()) { 157 if (!input_methods.empty()) {
158 // If the user has a preferred input method, enable it and switch to it. 158 // If the user has a preferred input method, enable it and switch to it.
159 chromeos::input_method::InputMethodManager* input_method_manager = 159 chromeos::input_method::InputMethodManager* input_method_manager =
160 chromeos::input_method::InputMethodManager::Get(); 160 chromeos::input_method::InputMethodManager::Get();
161 input_method_manager->EnableInputMethod(input_methods.front()); 161 input_method_manager->GetActiveIMEState()->EnableInputMethod(
162 input_method_manager->ChangeInputMethod(input_methods.front()); 162 input_methods.front());
163 input_method_manager->GetActiveIMEState()->ChangeInputMethod(
164 input_methods.front(), false /* show_message */);
163 } 165 }
164 166
165 // Updates the domain name shown in the UI. 167 // Updates the domain name shown in the UI.
166 UpdateDomainInUI(); 168 UpdateDomainInUI();
167 169
168 // Update the UI to show an error message or the Terms of Service. 170 // Update the UI to show an error message or the Terms of Service.
169 UpdateTermsOfServiceInUI(); 171 UpdateTermsOfServiceInUI();
170 172
171 ShowScreen(OobeUI::kScreenTermsOfService, NULL); 173 ShowScreen(OobeUI::kScreenTermsOfService, NULL);
172 } 174 }
(...skipping 30 matching lines...) Expand all
203 // and continue" button should not be accessible. If the user managed to 205 // and continue" button should not be accessible. If the user managed to
204 // activate it somehow anway, do not treat this as acceptance of the Terms 206 // activate it somehow anway, do not treat this as acceptance of the Terms
205 // and Conditions and end the session instead, as if the user had declined. 207 // and Conditions and end the session instead, as if the user had declined.
206 if (terms_of_service_.empty()) 208 if (terms_of_service_.empty())
207 screen_->OnDecline(); 209 screen_->OnDecline();
208 else 210 else
209 screen_->OnAccept(); 211 screen_->OnAccept();
210 } 212 }
211 213
212 } // namespace chromeos 214 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698