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

Side by Side Diff: chrome/browser/chromeos/login/screens/network_screen.cc

Issue 2934043002: Use ContainsValue() instead of std::find() in chrome/browser/chromeos (Closed)
Patch Set: Fixed compilation error. Created 3 years, 6 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) 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/login/screens/network_screen.h" 5 #include "chrome/browser/chromeos/login/screens/network_screen.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/stl_util.h"
11 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chromeos/base/locale_util.h" 15 #include "chrome/browser/chromeos/base/locale_util.h"
15 #include "chrome/browser/chromeos/customization/customization_document.h" 16 #include "chrome/browser/chromeos/customization/customization_document.h"
16 #include "chrome/browser/chromeos/login/help_app_launcher.h" 17 #include "chrome/browser/chromeos/login/help_app_launcher.h"
17 #include "chrome/browser/chromeos/login/helper.h" 18 #include "chrome/browser/chromeos/login/helper.h"
18 #include "chrome/browser/chromeos/login/screen_manager.h" 19 #include "chrome/browser/chromeos/login/screen_manager.h"
19 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" 20 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h"
20 #include "chrome/browser/chromeos/login/screens/network_view.h" 21 #include "chrome/browser/chromeos/login/screens/network_view.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 true /* login_layouts_only */, callback, 261 true /* login_layouts_only */, callback,
261 ProfileManager::GetActiveUserProfile()); 262 ProfileManager::GetActiveUserProfile());
262 } 263 }
263 264
264 void NetworkScreen::SetInputMethod(const std::string& input_method) { 265 void NetworkScreen::SetInputMethod(const std::string& input_method) {
265 const std::vector<std::string>& input_methods = 266 const std::vector<std::string>& input_methods =
266 input_method::InputMethodManager::Get() 267 input_method::InputMethodManager::Get()
267 ->GetActiveIMEState() 268 ->GetActiveIMEState()
268 ->GetActiveInputMethodIds(); 269 ->GetActiveInputMethodIds();
269 if (input_method.empty() || 270 if (input_method.empty() ||
270 std::find(input_methods.begin(), input_methods.end(), input_method) == 271 !base::ContainsValue(input_methods, input_method)) {
271 input_methods.end()) {
272 LOG(WARNING) << "The input method is empty or ineligible!"; 272 LOG(WARNING) << "The input method is empty or ineligible!";
273 return; 273 return;
274 } 274 }
275 input_method_ = input_method; 275 input_method_ = input_method;
276 input_method::InputMethodManager::Get() 276 input_method::InputMethodManager::Get()
277 ->GetActiveIMEState() 277 ->GetActiveIMEState()
278 ->ChangeInputMethod(input_method_, false /* show_message */); 278 ->ChangeInputMethod(input_method_, false /* show_message */);
279 } 279 }
280 280
281 void NetworkScreen::InitializeTimezoneObserver() { 281 void NetworkScreen::InitializeTimezoneObserver() {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 observer.OnLanguageListReloaded(); 441 observer.OnLanguageListReloaded();
442 } 442 }
443 443
444 void NetworkScreen::OnSystemTimezoneChanged() { 444 void NetworkScreen::OnSystemTimezoneChanged() {
445 std::string current_timezone_id; 445 std::string current_timezone_id;
446 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id); 446 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id);
447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); 447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id);
448 } 448 }
449 449
450 } // namespace chromeos 450 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_manager_impl.cc ('k') | chrome/browser/chromeos/mobile_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698