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

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

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/controller_pairing_screen.h" 5 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/login/wizard_controller.h" 10 #include "chrome/browser/chromeos/login/wizard_controller.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (!ExpectStageIs(ControllerPairingController::STAGE_DEVICES_DISCOVERY)) 146 if (!ExpectStageIs(ControllerPairingController::STAGE_DEVICES_DISCOVERY))
147 return; 147 return;
148 ControllerPairingController::DeviceIdList devices = 148 ControllerPairingController::DeviceIdList devices =
149 shark_controller_->GetDiscoveredDevices(); 149 shark_controller_->GetDiscoveredDevices();
150 std::sort(devices.begin(), devices.end()); 150 std::sort(devices.begin(), devices.end());
151 context_.SetStringList(kContextKeyDevices, devices); 151 context_.SetStringList(kContextKeyDevices, devices);
152 context_.SetString( 152 context_.SetString(
153 kContextKeyPage, 153 kContextKeyPage,
154 devices.empty() ? kPageDevicesDiscovery : kPageDeviceSelect); 154 devices.empty() ? kPageDevicesDiscovery : kPageDeviceSelect);
155 std::string selected_device = context_.GetString(kContextKeySelectedDevice); 155 std::string selected_device = context_.GetString(kContextKeySelectedDevice);
156 if (!ContainsValue(devices, selected_device)) 156 if (!base::ContainsValue(devices, selected_device))
157 selected_device.clear(); 157 selected_device.clear();
158 if (devices.empty()) { 158 if (devices.empty()) {
159 device_preselected_ = false; 159 device_preselected_ = false;
160 } else if (!device_preselected_) { 160 } else if (!device_preselected_) {
161 selected_device = devices.front(); 161 selected_device = devices.front();
162 device_preselected_ = true; 162 device_preselected_ = true;
163 } 163 }
164 context_.SetString(kContextKeySelectedDevice, selected_device); 164 context_.SetString(kContextKeySelectedDevice, selected_device);
165 context_.SetBoolean(kContextKeyControlsDisabled, selected_device.empty()); 165 context_.SetBoolean(kContextKeyControlsDisabled, selected_device.empty());
166 CommitContextChanges(); 166 CommitContextChanges();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ++key) { 215 ++key) {
216 if (*key == kContextKeySelectedDevice) { 216 if (*key == kContextKeySelectedDevice) {
217 context_.SetBoolean(kContextKeyControlsDisabled, 217 context_.SetBoolean(kContextKeyControlsDisabled,
218 context_.GetString(*key).empty()); 218 context_.GetString(*key).empty());
219 CommitContextChanges(); 219 CommitContextChanges();
220 } 220 }
221 } 221 }
222 } 222 }
223 223
224 } // namespace chromeos 224 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h ('k') | chrome/browser/chromeos/mobile_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698