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

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

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 base::DictionaryValue localized_strings; 142 base::DictionaryValue localized_strings;
143 static_cast<OobeUI*>(web_ui()->GetController()) 143 static_cast<OobeUI*>(web_ui()->GetController())
144 ->GetLocalizedStrings(&localized_strings); 144 ->GetLocalizedStrings(&localized_strings);
145 core_oobe_actor_->ReloadContent(localized_strings); 145 core_oobe_actor_->ReloadContent(localized_strings);
146 146
147 DoShow(); 147 DoShow();
148 } 148 }
149 149
150 void TermsOfServiceScreenHandler::DoShow() { 150 void TermsOfServiceScreenHandler::DoShow() {
151 // Determine the user's most preferred input method. 151 // Determine the user's most preferred input method.
152 std::vector<std::string> input_methods; 152 std::vector<std::string> input_methods = base::SplitString(
153 base::SplitString(
154 ProfileHelper::Get() 153 ProfileHelper::Get()
155 ->GetProfileByUserUnsafe( 154 ->GetProfileByUserUnsafe(
156 user_manager::UserManager::Get()->GetActiveUser()) 155 user_manager::UserManager::Get()->GetActiveUser())
157 ->GetPrefs() 156 ->GetPrefs()
158 ->GetString(prefs::kLanguagePreloadEngines), 157 ->GetString(prefs::kLanguagePreloadEngines),
159 ',', 158 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
160 &input_methods);
161 159
162 if (!input_methods.empty()) { 160 if (!input_methods.empty()) {
163 // If the user has a preferred input method, enable it and switch to it. 161 // If the user has a preferred input method, enable it and switch to it.
164 chromeos::input_method::InputMethodManager* input_method_manager = 162 chromeos::input_method::InputMethodManager* input_method_manager =
165 chromeos::input_method::InputMethodManager::Get(); 163 chromeos::input_method::InputMethodManager::Get();
166 input_method_manager->GetActiveIMEState()->EnableInputMethod( 164 input_method_manager->GetActiveIMEState()->EnableInputMethod(
167 input_methods.front()); 165 input_methods.front());
168 input_method_manager->GetActiveIMEState()->ChangeInputMethod( 166 input_method_manager->GetActiveIMEState()->ChangeInputMethod(
169 input_methods.front(), false /* show_message */); 167 input_methods.front(), false /* show_message */);
170 } 168 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // and continue" button should not be accessible. If the user managed to 208 // 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 209 // 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. 210 // and Conditions and end the session instead, as if the user had declined.
213 if (terms_of_service_.empty()) 211 if (terms_of_service_.empty())
214 screen_->OnDecline(); 212 screen_->OnDecline();
215 else 213 else
216 screen_->OnAccept(); 214 screen_->OnAccept();
217 } 215 }
218 216
219 } // namespace chromeos 217 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/expanding_textfield.cc ('k') | chrome/browser/ui/webui/cookies_tree_model_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698