| 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 28f61d308880e09c765572d6d12d1b3bfdffd1f8..acd5442f3310cf628cb26717ae5fb67175c63f0d 100644
|
| --- a/ash/common/system/chromeos/palette/palette_utils.cc
|
| +++ b/ash/common/system/chromeos/palette/palette_utils.cc
|
| @@ -11,13 +11,28 @@
|
| #include "ash/common/wm_shell.h"
|
| #include "ash/common/wm_window.h"
|
| #include "base/command_line.h"
|
| +#include "ui/events/devices/input_device_manager.h"
|
| +#include "ui/events/devices/touchscreen_device.h"
|
| #include "ui/gfx/geometry/point.h"
|
|
|
| namespace ash {
|
|
|
| -bool IsPaletteFeatureEnabled() {
|
| - return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kAshEnablePalette);
|
| +bool HasStylusInput() {
|
| + // Allow the user to force-enable by passing a switch.
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kAshForceEnablePalette)) {
|
| + return true;
|
| + }
|
| +
|
| + for (const ui::TouchscreenDevice& device :
|
| + ui::InputDeviceManager::GetInstance()->GetTouchscreenDevices()) {
|
| + if (device.is_stylus &&
|
| + device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
|
| + return true;
|
| + }
|
| + }
|
| +
|
| + return false;
|
| }
|
|
|
| bool IsPaletteEnabledOnEveryDisplay() {
|
|
|