| 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/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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 wm_shelf_, WmLookup::Get()->GetWindowForWidget(this), system_tray_); | 205 wm_shelf_, WmLookup::Get()->GetWindowForWidget(this), system_tray_); |
| 206 status_area_widget_delegate_->AddTray(web_notification_tray_); | 206 status_area_widget_delegate_->AddTray(web_notification_tray_); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void StatusAreaWidget::AddLogoutButtonTray() { | 209 void StatusAreaWidget::AddLogoutButtonTray() { |
| 210 logout_button_tray_ = new LogoutButtonTray(wm_shelf_); | 210 logout_button_tray_ = new LogoutButtonTray(wm_shelf_); |
| 211 status_area_widget_delegate_->AddTray(logout_button_tray_); | 211 status_area_widget_delegate_->AddTray(logout_button_tray_); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void StatusAreaWidget::AddPaletteTray() { | 214 void StatusAreaWidget::AddPaletteTray() { |
| 215 if (!IsPaletteFeatureEnabled()) | |
| 216 return; | |
| 217 | |
| 218 const display::Display& display = | 215 const display::Display& display = |
| 219 WmLookup::Get()->GetWindowForWidget(this)->GetDisplayNearestWindow(); | 216 WmLookup::Get()->GetWindowForWidget(this)->GetDisplayNearestWindow(); |
| 220 | 217 |
| 221 // Create the palette only on the internal display, where the stylus is | 218 // Create the palette only on the internal display, where the stylus is |
| 222 // available. We also create a palette on every display if requested from the | 219 // available. We also create a palette on every display if requested from the |
| 223 // command line. | 220 // command line. |
| 224 if (display.IsInternal() || IsPaletteEnabledOnEveryDisplay()) { | 221 if (display.IsInternal() || palette_utils::IsPaletteEnabledOnEveryDisplay()) { |
| 225 palette_tray_ = new PaletteTray(wm_shelf_); | 222 palette_tray_ = new PaletteTray(wm_shelf_); |
| 226 status_area_widget_delegate_->AddTray(palette_tray_); | 223 status_area_widget_delegate_->AddTray(palette_tray_); |
| 227 } | 224 } |
| 228 } | 225 } |
| 229 | 226 |
| 230 void StatusAreaWidget::AddVirtualKeyboardTray() { | 227 void StatusAreaWidget::AddVirtualKeyboardTray() { |
| 231 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); | 228 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); |
| 232 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); | 229 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); |
| 233 } | 230 } |
| 234 | 231 |
| 235 void StatusAreaWidget::AddImeMenuTray() { | 232 void StatusAreaWidget::AddImeMenuTray() { |
| 236 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); | 233 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); |
| 237 status_area_widget_delegate_->AddTray(ime_menu_tray_); | 234 status_area_widget_delegate_->AddTray(ime_menu_tray_); |
| 238 } | 235 } |
| 239 | 236 |
| 240 void StatusAreaWidget::AddOverviewButtonTray() { | 237 void StatusAreaWidget::AddOverviewButtonTray() { |
| 241 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); | 238 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); |
| 242 status_area_widget_delegate_->AddTray(overview_button_tray_); | 239 status_area_widget_delegate_->AddTray(overview_button_tray_); |
| 243 } | 240 } |
| 244 | 241 |
| 245 } // namespace ash | 242 } // namespace ash |
| OLD | NEW |