| Index: chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.cc
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.cc b/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.cc
|
| index 7118b9f5ec4b410f04a938531f3bed478c73c192..c15ebeaea036c60b6d6e1325240edd6758194913 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.cc
|
| @@ -4,17 +4,13 @@
|
|
|
| #include "chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.h"
|
|
|
| -#include <stdint.h>
|
| -
|
| #include "ash/display/window_tree_host_manager.h"
|
| #include "ash/shell.h"
|
| -#include "base/stl_util.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "ui/display/display.h"
|
| +#include "ui/display/display_layout.h"
|
| #include "ui/display/manager/display_manager.h"
|
| #include "ui/display/screen.h"
|
| -#include "ui/events/devices/device_data_manager.h"
|
| -#include "ui/events/devices/touchscreen_device.h"
|
|
|
| using content::BrowserThread;
|
|
|
| @@ -26,9 +22,6 @@
|
| return display.touch_support() ==
|
| display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE;
|
| }
|
| -
|
| -// TODO(felixe): More context at crbug.com/738885
|
| -const uint16_t kDeviceIds[] = {0x0457, 0x266e};
|
|
|
| } // namespace
|
|
|
| @@ -58,21 +51,18 @@
|
| void OobeDisplayChooser::MoveToTouchDisplay() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
| - const ui::DeviceDataManager* device_manager =
|
| - ui::DeviceDataManager::GetInstance();
|
| - for (const ui::TouchscreenDevice& device :
|
| - device_manager->GetTouchscreenDevices()) {
|
| - if (!base::ContainsValue(kDeviceIds, device.vendor_id))
|
| - continue;
|
| + const display::Displays& displays =
|
| + ash::Shell::Get()->display_manager()->active_only_display_list();
|
|
|
| - int64_t display_id =
|
| - device_manager->GetTargetDisplayForTouchDevice(device.id);
|
| - if (display_id == display::kInvalidDisplayId)
|
| - continue;
|
| + if (displays.size() <= 1)
|
| + return;
|
|
|
| - ash::Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(
|
| - display_id);
|
| - break;
|
| + for (const display::Display& display : displays) {
|
| + if (TouchSupportAvailable(display)) {
|
| + ash::Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(
|
| + display.id());
|
| + break;
|
| + }
|
| }
|
| }
|
|
|
|
|