Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: ash/common/system/status_area_widget.cc

Issue 2297393002: cros/ash: Only show the stylus palette on the internal display. (Closed)
Patch Set: Initial upload Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_);
}

Powered by Google App Engine
This is Rietveld 408576698