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

Side by Side Diff: ash/common/system/status_area_widget.cc

Issue 2644713002: cros: Use runtime stylus detection for ash palette. (Closed)
Patch Set: Fix test Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/status_area_widget.h" 5 #include "ash/common/system/status_area_widget.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/wm_shelf.h" 8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" 9 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
10 #include "ash/common/system/chromeos/palette/palette_tray.h" 10 #include "ash/common/system/chromeos/palette/palette_tray.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 wm_shelf_, WmLookup::Get()->GetWindowForWidget(this), system_tray_); 203 wm_shelf_, WmLookup::Get()->GetWindowForWidget(this), system_tray_);
204 status_area_widget_delegate_->AddTray(web_notification_tray_); 204 status_area_widget_delegate_->AddTray(web_notification_tray_);
205 } 205 }
206 206
207 void StatusAreaWidget::AddLogoutButtonTray() { 207 void StatusAreaWidget::AddLogoutButtonTray() {
208 logout_button_tray_ = new LogoutButtonTray(wm_shelf_); 208 logout_button_tray_ = new LogoutButtonTray(wm_shelf_);
209 status_area_widget_delegate_->AddTray(logout_button_tray_); 209 status_area_widget_delegate_->AddTray(logout_button_tray_);
210 } 210 }
211 211
212 void StatusAreaWidget::AddPaletteTray() { 212 void StatusAreaWidget::AddPaletteTray() {
213 if (!IsPaletteFeatureEnabled())
214 return;
215
216 const display::Display& display = 213 const display::Display& display =
217 WmLookup::Get()->GetWindowForWidget(this)->GetDisplayNearestWindow(); 214 WmLookup::Get()->GetWindowForWidget(this)->GetDisplayNearestWindow();
218 215
219 // Create the palette only on the internal display, where the stylus is 216 // Create the palette only on the internal display, where the stylus is
220 // available. We also create a palette on every display if requested from the 217 // available. We also create a palette on every display if requested from the
221 // command line. 218 // command line.
222 if (display.IsInternal() || IsPaletteEnabledOnEveryDisplay()) { 219 if (display.IsInternal() || palette_utils::IsPaletteEnabledOnEveryDisplay()) {
223 palette_tray_ = new PaletteTray(wm_shelf_); 220 palette_tray_ = new PaletteTray(wm_shelf_);
224 status_area_widget_delegate_->AddTray(palette_tray_); 221 status_area_widget_delegate_->AddTray(palette_tray_);
225 } 222 }
226 } 223 }
227 224
228 void StatusAreaWidget::AddVirtualKeyboardTray() { 225 void StatusAreaWidget::AddVirtualKeyboardTray() {
229 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); 226 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_);
230 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); 227 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_);
231 } 228 }
232 229
233 void StatusAreaWidget::AddImeMenuTray() { 230 void StatusAreaWidget::AddImeMenuTray() {
234 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); 231 ime_menu_tray_ = new ImeMenuTray(wm_shelf_);
235 status_area_widget_delegate_->AddTray(ime_menu_tray_); 232 status_area_widget_delegate_->AddTray(ime_menu_tray_);
236 } 233 }
237 234
238 void StatusAreaWidget::AddOverviewButtonTray() { 235 void StatusAreaWidget::AddOverviewButtonTray() {
239 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); 236 overview_button_tray_ = new OverviewButtonTray(wm_shelf_);
240 status_area_widget_delegate_->AddTray(overview_button_tray_); 237 status_area_widget_delegate_->AddTray(overview_button_tray_);
241 } 238 }
242 239
243 } // namespace ash 240 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/palette_utils.cc ('k') | ash/common/test/test_palette_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698