Chromium Code Reviews| Index: ui/base/material_design/material_design_controller.cc |
| diff --git a/ui/base/material_design/material_design_controller.cc b/ui/base/material_design/material_design_controller.cc |
| index 411f553a8ba2176680caf3caebaad04334e26c84..d1b2e7cd026ced9080aae69d9fb262363a8ba41d 100644 |
| --- a/ui/base/material_design/material_design_controller.cc |
| +++ b/ui/base/material_design/material_design_controller.cc |
| @@ -17,6 +17,7 @@ |
| #include <fcntl.h> |
| #include "base/files/file_enumerator.h" |
| +#include "base/threading/thread_restrictions.h" |
| #include "ui/events/ozone/evdev/event_device_info.h" |
| #endif // defined(USE_OZONE) |
| @@ -43,6 +44,8 @@ bool MaterialDesignController::IsModeMaterial() { |
| MaterialDesignController::Mode MaterialDesignController::DefaultMode() { |
| #if defined(OS_CHROMEOS) |
| + // If a scan of available devices has already completed, use material-hybrid |
| + // if a touchscreen is present. |
| if (DeviceDataManager::HasInstance() && |
| DeviceDataManager::GetInstance()->device_lists_complete()) { |
| return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED ? |
| @@ -50,6 +53,9 @@ MaterialDesignController::Mode MaterialDesignController::DefaultMode() { |
| } |
| #if defined(USE_OZONE) |
| + // Otherwise perform our own scan to determine the presence of a touchscreen. |
| + // Note this is a one-time call that occurs during device startup or restart. |
| + base::ThreadRestrictions::ScopedAllowIO allow_io; |
|
sadrul
2016/03/30 19:14:18
I am not a fan of this. Can we just stick with the
tdanderson
2016/03/30 19:26:12
The block above is insufficient since whenever the
|
| base::FileEnumerator file_enum( |
| base::FilePath(FILE_PATH_LITERAL("/dev/input")), false, |
| base::FileEnumerator::FILES, FILE_PATH_LITERAL("event*[0-9]")); |