Index: ash/virtual_keyboard_controller.cc |
diff --git a/ash/virtual_keyboard_controller.cc b/ash/virtual_keyboard_controller.cc |
index 5c54f46960871a350db5577309109df5a938f7cf..18050cb1b43e1a48d41dad40ea924eac902193dd 100644 |
--- a/ash/virtual_keyboard_controller.cc |
+++ b/ash/virtual_keyboard_controller.cc |
@@ -72,13 +72,11 @@ void VirtualKeyboardController::UpdateDevices() { |
// Checks for keyboards. |
has_external_keyboard_ = false; |
has_internal_keyboard_ = false; |
- std::vector<ui::KeyboardDevice> keyboards = |
- device_data_manager->keyboard_devices(); |
- for (auto iter = keyboards.begin(); |
- iter != keyboards.end() || |
- (has_internal_keyboard_ && has_external_keyboard_); |
- ++iter) { |
- ui::InputDeviceType type = (*iter).type; |
+ for (const ui::KeyboardDevice& device : |
+ device_data_manager->keyboard_devices()) { |
+ if (has_internal_keyboard_ && has_external_keyboard_) |
+ break; |
+ ui::InputDeviceType type = device.type; |
if (type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) |
has_internal_keyboard_ = true; |
if (type == ui::InputDeviceType::INPUT_DEVICE_EXTERNAL) |