Index: ash/system/palette/palette_utils.cc |
diff --git a/ash/system/palette/palette_utils.cc b/ash/system/palette/palette_utils.cc |
index 7181d6c5addf6bcfab86b78c472dfc6c2475d078..74ffce3c4a9f83cb7dd23008911a78a1c635b531 100644 |
--- a/ash/system/palette/palette_utils.cc |
+++ b/ash/system/palette/palette_utils.cc |
@@ -11,6 +11,7 @@ |
#include "ash/system/status_area_widget.h" |
#include "ash/wm_window.h" |
#include "base/command_line.h" |
+#include "ui/display/display.h" |
#include "ui/events/devices/input_device_manager.h" |
#include "ui/events/devices/touchscreen_device.h" |
#include "ui/gfx/geometry/point.h" |
@@ -22,7 +23,7 @@ bool HasStylusInput() { |
// 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)) { |
+ switches::kAshForceEnableStylusTools)) { |
return true; |
} |
@@ -43,6 +44,11 @@ bool IsPaletteEnabledOnEveryDisplay() { |
switches::kAshEnablePaletteOnAllDisplays); |
} |
+bool ShouldCreatePalette() { |
+ return HasStylusInput() && (display::Display::HasInternalDisplay() || |
+ IsPaletteEnabledOnEveryDisplay()); |
+} |
+ |
bool PaletteContainsPointInScreen(const gfx::Point& point) { |
for (WmWindow* window : ShellPort::Get()->GetAllRootWindows()) { |
PaletteTray* palette_tray = |