| Index: ash/common/system/chromeos/palette/palette_utils.cc
|
| diff --git a/ash/common/system/chromeos/palette/palette_utils.cc b/ash/common/system/chromeos/palette/palette_utils.cc
|
| index f32e40c2c1d241818618e559e1a171e39fca7768..c8c496bb3ce94c8182ef46f2672e4dbe9ec8822f 100644
|
| --- a/ash/common/system/chromeos/palette/palette_utils.cc
|
| +++ b/ash/common/system/chromeos/palette/palette_utils.cc
|
| @@ -11,6 +11,7 @@
|
| #include "ash/common/wm_shell.h"
|
| #include "ash/common/wm_window.h"
|
| #include "base/command_line.h"
|
| +#include "base/sys_info.h"
|
| #include "ui/events/devices/input_device_manager.h"
|
| #include "ui/events/devices/touchscreen_device.h"
|
| #include "ui/gfx/geometry/point.h"
|
| @@ -18,13 +19,31 @@
|
| namespace ash {
|
| namespace palette_utils {
|
|
|
| +namespace {
|
| +// Pyro firmware currently reports it has a stylus but it does not.
|
| +// TODO(jdufault): Remove this once firmware is fixed. See b/36367810.
|
| +const char* kBlacklistedDevices[] = {"pyro"};
|
| +
|
| +bool IsBlacklisted(const std::string& name) {
|
| + return std::find(std::begin(kBlacklistedDevices),
|
| + std::end(kBlacklistedDevices),
|
| + name) != std::end(kBlacklistedDevices);
|
| +}
|
| +} // namespace
|
| +
|
| bool HasStylusInput() {
|
| - // Allow the user to force-enable by passing a switch.
|
| + // Allow the user to force enable or disable by passing a switch. If both are
|
| + // present, enabling takes precedence over disabling.
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kAshForceEnablePalette)) {
|
| return true;
|
| }
|
|
|
| + // Disable stylus for any blacklisted devices.
|
| + if (IsBlacklisted(base::SysInfo::GetLsbReleaseBoard()))
|
| + return false;
|
| +
|
| + // Check to see if the hardware reports it is stylus capable.
|
| for (const ui::TouchscreenDevice& device :
|
| ui::InputDeviceManager::GetInstance()->GetTouchscreenDevices()) {
|
| if (device.is_stylus &&
|
|
|