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

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

Issue 2833093002: WIP: simplified display management in ash (Closed)
Patch Set: x Created 3 years, 8 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
« no previous file with comments | « ash/shell_init_params.h ('k') | ash/system/toast/toast_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/system/status_area_widget.h" 5 #include "ash/system/status_area_widget.h"
6 6
7 #include "ash/public/cpp/config.h"
7 #include "ash/public/cpp/shell_window_ids.h" 8 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
9 #include "ash/shelf/wm_shelf.h" 10 #include "ash/shelf/wm_shelf.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/system/ime_menu/ime_menu_tray.h" 12 #include "ash/system/ime_menu/ime_menu_tray.h"
12 #include "ash/system/overview/overview_button_tray.h" 13 #include "ash/system/overview/overview_button_tray.h"
13 #include "ash/system/palette/palette_tray.h" 14 #include "ash/system/palette/palette_tray.h"
14 #include "ash/system/palette/palette_utils.h" 15 #include "ash/system/palette/palette_utils.h"
15 #include "ash/system/session/logout_button_tray.h" 16 #include "ash/system/session/logout_button_tray.h"
16 #include "ash/system/status_area_widget_delegate.h" 17 #include "ash/system/status_area_widget_delegate.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 status_area_widget_delegate_->AddTray(logout_button_tray_); 206 status_area_widget_delegate_->AddTray(logout_button_tray_);
206 } 207 }
207 208
208 void StatusAreaWidget::AddPaletteTray() { 209 void StatusAreaWidget::AddPaletteTray() {
209 const display::Display& display = 210 const display::Display& display =
210 WmWindow::Get(this->GetNativeWindow())->GetDisplayNearestWindow(); 211 WmWindow::Get(this->GetNativeWindow())->GetDisplayNearestWindow();
211 212
212 // Create the palette only on the internal display, where the stylus is 213 // Create the palette only on the internal display, where the stylus is
213 // available. We also create a palette on every display if requested from the 214 // available. We also create a palette on every display if requested from the
214 // command line. 215 // command line.
215 if (display.IsInternal() || palette_utils::IsPaletteEnabledOnEveryDisplay()) { 216 if (Shell::GetAshConfig() == Config::CLASSIC &&
217 (display.IsInternal() ||
218 palette_utils::IsPaletteEnabledOnEveryDisplay())) {
216 palette_tray_ = new PaletteTray(wm_shelf_); 219 palette_tray_ = new PaletteTray(wm_shelf_);
217 status_area_widget_delegate_->AddTray(palette_tray_); 220 status_area_widget_delegate_->AddTray(palette_tray_);
218 } 221 }
219 } 222 }
220 223
221 void StatusAreaWidget::AddVirtualKeyboardTray() { 224 void StatusAreaWidget::AddVirtualKeyboardTray() {
222 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_); 225 virtual_keyboard_tray_ = new VirtualKeyboardTray(wm_shelf_);
223 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); 226 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_);
224 } 227 }
225 228
226 void StatusAreaWidget::AddImeMenuTray() { 229 void StatusAreaWidget::AddImeMenuTray() {
227 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); 230 ime_menu_tray_ = new ImeMenuTray(wm_shelf_);
228 status_area_widget_delegate_->AddTray(ime_menu_tray_); 231 status_area_widget_delegate_->AddTray(ime_menu_tray_);
229 } 232 }
230 233
231 void StatusAreaWidget::AddOverviewButtonTray() { 234 void StatusAreaWidget::AddOverviewButtonTray() {
232 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); 235 overview_button_tray_ = new OverviewButtonTray(wm_shelf_);
233 status_area_widget_delegate_->AddTray(overview_button_tray_); 236 status_area_widget_delegate_->AddTray(overview_button_tray_);
234 } 237 }
235 238
236 } // namespace ash 239 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_init_params.h ('k') | ash/system/toast/toast_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698