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

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: Address comments Created 4 years, 3 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..f9b41edbe1e24430e49b800b50c7fa85ac6d4f01 100644
--- a/ash/common/system/status_area_widget.cc
+++ b/ash/common/system/status_area_widget.cc
@@ -25,6 +25,7 @@
#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"
#endif
namespace ash {
@@ -251,7 +252,16 @@ void StatusAreaWidget::AddLogoutButtonTray() {
}
void StatusAreaWidget::AddPaletteTray() {
- if (IsPaletteFeatureEnabled()) {
+ if (!IsPaletteFeatureEnabled())
+ return;
+
+ const display::Display& display =
+ WmLookup::Get()->GetWindowForWidget(this)->GetDisplayNearestWindow();
+
+ // 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_);
}
« no previous file with comments | « ash/common/system/chromeos/palette/palette_utils.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698