Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/system/status_area_widget.h" | 5 #include "ash/system/status_area_widget.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/wm_shelf.h" | 9 #include "ash/shelf/wm_shelf.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 wm_shelf_, WmWindow::Get(this->GetNativeWindow()), system_tray_); | 202 wm_shelf_, WmWindow::Get(this->GetNativeWindow()), system_tray_); |
| 203 status_area_widget_delegate_->AddTray(web_notification_tray_); | 203 status_area_widget_delegate_->AddTray(web_notification_tray_); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void StatusAreaWidget::AddLogoutButtonTray() { | 206 void StatusAreaWidget::AddLogoutButtonTray() { |
| 207 logout_button_tray_ = new LogoutButtonTray(wm_shelf_); | 207 logout_button_tray_ = new LogoutButtonTray(wm_shelf_); |
| 208 status_area_widget_delegate_->AddTray(logout_button_tray_); | 208 status_area_widget_delegate_->AddTray(logout_button_tray_); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void StatusAreaWidget::AddPaletteTray() { | 211 void StatusAreaWidget::AddPaletteTray() { |
| 212 const display::Display& display = | 212 const display::Display& display = |
|
jdufault
2017/04/19 22:58:38
Instead of checking in the if below just short-cir
wutao
2017/04/20 16:17:51
Done.
| |
| 213 WmWindow::Get(this->GetNativeWindow())->GetDisplayNearestWindow(); | 213 WmWindow::Get(this->GetNativeWindow())->GetDisplayNearestWindow(); |
| 214 | 214 |
| 215 // Create the palette only on the internal display, where the stylus is | 215 // Create the palette only on the internal display, where the stylus is |
| 216 // available. We also create a palette on every display if requested from the | 216 // available. We also create a palette on every display if requested from the |
| 217 // command line. | 217 // command line. |
| 218 if (display.IsInternal() || palette_utils::IsPaletteEnabledOnEveryDisplay()) { | 218 if (palette_utils::HasStylusInput() && |
| 219 (display.IsInternal() || | |
| 220 palette_utils::IsPaletteEnabledOnEveryDisplay())) { | |
| 219 palette_tray_ = new PaletteTray(wm_shelf_); | 221 palette_tray_ = new PaletteTray(wm_shelf_); |
| 220 status_area_widget_delegate_->AddTray(palette_tray_); | 222 status_area_widget_delegate_->AddTray(palette_tray_); |
| 221 } | 223 } |
| 222 } | 224 } |
| 223 | 225 |
| 224 void StatusAreaWidget::AddVirtualKeyboardTray() { | 226 void StatusAreaWidget::AddVirtualKeyboardTray() { |
| 225 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); | 227 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); |
| 226 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); | 228 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); |
| 227 } | 229 } |
| 228 | 230 |
| 229 void StatusAreaWidget::AddImeMenuTray() { | 231 void StatusAreaWidget::AddImeMenuTray() { |
| 230 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); | 232 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); |
| 231 status_area_widget_delegate_->AddTray(ime_menu_tray_); | 233 status_area_widget_delegate_->AddTray(ime_menu_tray_); |
| 232 } | 234 } |
| 233 | 235 |
| 234 void StatusAreaWidget::AddOverviewButtonTray() { | 236 void StatusAreaWidget::AddOverviewButtonTray() { |
| 235 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); | 237 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); |
| 236 status_area_widget_delegate_->AddTray(overview_button_tray_); | 238 status_area_widget_delegate_->AddTray(overview_button_tray_); |
| 237 } | 239 } |
| 238 | 240 |
| 239 } // namespace ash | 241 } // namespace ash |
| OLD | NEW |