Chromium Code Reviews| Index: ash/common/system/status_area_widget.cc |
| diff --git a/ash/common/system/status_area_widget.cc b/ash/common/system/status_area_widget.cc |
| index cf5ae68e1a7ff2b35187053b56b02bf069553dae..0dcd8f9f5a68575dc1535c2bdbe34fece19a26bd 100644 |
| --- a/ash/common/system/status_area_widget.cc |
| +++ b/ash/common/system/status_area_widget.cc |
| @@ -25,6 +25,8 @@ |
| #include "ash/common/system/chromeos/palette/palette_utils.h" |
| #include "ash/common/system/chromeos/session/logout_button_tray.h" |
| #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" |
| +#include "ui/display/display.h" |
| +#include "ui/display/screen.h" |
| #endif |
| namespace ash { |
| @@ -251,7 +253,16 @@ void StatusAreaWidget::AddLogoutButtonTray() { |
| } |
| void StatusAreaWidget::AddPaletteTray() { |
| - if (IsPaletteFeatureEnabled()) { |
| + if (!IsPaletteFeatureEnabled()) |
| + return; |
| + |
| + const display::Display& display = |
| + display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeWindow()); |
|
James Cook
2016/09/01 17:00:55
Use WmLookup::Get()->GetWindowForWidget(this)->Get
jdufault
2016/09/02 20:12:37
Done.
|
| + |
| + // Create the palette only on the internal display, where the stylus is |
| + // available. We also create a palette on every display if requested from the |
| + // command line. |
| + if (display.IsInternal() || IsPaletteEnabledOnEveryDisplay()) { |
| palette_tray_ = new PaletteTray(wm_shelf_); |
| status_area_widget_delegate_->AddTray(palette_tray_); |
| } |