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/system/tray/system_tray.cc

Issue 2888983003: chromeos: Remove ash::SystemTrayDelegate::CreateTrayRotationLock (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | ash/system/tray/system_tray_delegate.h » ('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/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/key_event_watcher.h" 11 #include "ash/key_event_watcher.h"
12 #include "ash/login_status.h" 12 #include "ash/login_status.h"
13 #include "ash/public/cpp/config.h"
13 #include "ash/public/cpp/shell_window_ids.h" 14 #include "ash/public/cpp/shell_window_ids.h"
14 #include "ash/root_window_controller.h" 15 #include "ash/root_window_controller.h"
15 #include "ash/session/session_controller.h" 16 #include "ash/session/session_controller.h"
16 #include "ash/shelf/wm_shelf.h" 17 #include "ash/shelf/wm_shelf.h"
17 #include "ash/shell.h" 18 #include "ash/shell.h"
18 #include "ash/shell_port.h" 19 #include "ash/shell_port.h"
19 #include "ash/strings/grit/ash_strings.h" 20 #include "ash/strings/grit/ash_strings.h"
20 #include "ash/system/audio/tray_audio.h" 21 #include "ash/system/audio/tray_audio.h"
21 #include "ash/system/bluetooth/tray_bluetooth.h" 22 #include "ash/system/bluetooth/tray_bluetooth.h"
22 #include "ash/system/brightness/tray_brightness.h" 23 #include "ash/system/brightness/tray_brightness.h"
23 #include "ash/system/cast/tray_cast.h" 24 #include "ash/system/cast/tray_cast.h"
24 #include "ash/system/date/tray_system_info.h" 25 #include "ash/system/date/tray_system_info.h"
25 #include "ash/system/display_scale/tray_scale.h" 26 #include "ash/system/display_scale/tray_scale.h"
26 #include "ash/system/enterprise/tray_enterprise.h" 27 #include "ash/system/enterprise/tray_enterprise.h"
27 #include "ash/system/ime/tray_ime_chromeos.h" 28 #include "ash/system/ime/tray_ime_chromeos.h"
28 #include "ash/system/media_security/multi_profile_media_tray_item.h" 29 #include "ash/system/media_security/multi_profile_media_tray_item.h"
29 #include "ash/system/network/tray_network.h" 30 #include "ash/system/network/tray_network.h"
30 #include "ash/system/network/tray_vpn.h" 31 #include "ash/system/network/tray_vpn.h"
31 #include "ash/system/night_light/tray_night_light.h" 32 #include "ash/system/night_light/tray_night_light.h"
32 #include "ash/system/power/power_status.h" 33 #include "ash/system/power/power_status.h"
33 #include "ash/system/power/tray_power.h" 34 #include "ash/system/power/tray_power.h"
35 #include "ash/system/rotation/tray_rotation_lock.h"
34 #include "ash/system/screen_security/screen_capture_tray_item.h" 36 #include "ash/system/screen_security/screen_capture_tray_item.h"
35 #include "ash/system/screen_security/screen_share_tray_item.h" 37 #include "ash/system/screen_security/screen_share_tray_item.h"
36 #include "ash/system/session/tray_session_length_limit.h" 38 #include "ash/system/session/tray_session_length_limit.h"
37 #include "ash/system/supervised/tray_supervised_user.h" 39 #include "ash/system/supervised/tray_supervised_user.h"
38 #include "ash/system/tiles/tray_tiles.h" 40 #include "ash/system/tiles/tray_tiles.h"
39 #include "ash/system/tray/system_tray_controller.h" 41 #include "ash/system/tray/system_tray_controller.h"
40 #include "ash/system/tray/system_tray_delegate.h"
41 #include "ash/system/tray/system_tray_item.h" 42 #include "ash/system/tray/system_tray_item.h"
42 #include "ash/system/tray/tray_bubble_wrapper.h" 43 #include "ash/system/tray/tray_bubble_wrapper.h"
43 #include "ash/system/tray/tray_constants.h" 44 #include "ash/system/tray/tray_constants.h"
44 #include "ash/system/tray/tray_container.h" 45 #include "ash/system/tray/tray_container.h"
45 #include "ash/system/tray_accessibility.h" 46 #include "ash/system/tray_accessibility.h"
46 #include "ash/system/tray_caps_lock.h" 47 #include "ash/system/tray_caps_lock.h"
47 #include "ash/system/tray_tracing.h" 48 #include "ash/system/tray_tracing.h"
48 #include "ash/system/update/tray_update.h" 49 #include "ash/system/update/tray_update.h"
49 #include "ash/system/user/tray_user.h" 50 #include "ash/system/user/tray_user.h"
50 #include "ash/system/web_notification/web_notification_tray.h" 51 #include "ash/system/web_notification/web_notification_tray.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); 261 AddTrayItem(base::WrapUnique(screen_share_tray_item_));
261 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); 262 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this));
262 tray_audio_ = new TrayAudio(this); 263 tray_audio_ = new TrayAudio(this);
263 AddTrayItem(base::WrapUnique(tray_audio_)); 264 AddTrayItem(base::WrapUnique(tray_audio_));
264 tray_scale_ = new TrayScale(this); 265 tray_scale_ = new TrayScale(this);
265 AddTrayItem(base::WrapUnique(tray_scale_)); 266 AddTrayItem(base::WrapUnique(tray_scale_));
266 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); 267 AddTrayItem(base::MakeUnique<TrayBrightness>(this));
267 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); 268 AddTrayItem(base::MakeUnique<TrayCapsLock>(this));
268 tray_night_light_ = new TrayNightLight(this); 269 tray_night_light_ = new TrayNightLight(this);
269 AddTrayItem(base::WrapUnique(tray_night_light_)); 270 AddTrayItem(base::WrapUnique(tray_night_light_));
270 // TODO(jamescook): Remove this when mus has support for display management 271 // TODO(jamescook): Remove this when mash has support for display management
271 // and we have a DisplayManager equivalent. See http://crbug.com/548429 272 // and we have a DisplayManager equivalent. See http://crbug.com/548429
272 std::unique_ptr<SystemTrayItem> tray_rotation_lock = 273 if (Shell::GetAshConfig() != Config::MASH)
273 delegate->CreateRotationLockTrayItem(this); 274 AddTrayItem(base::MakeUnique<TrayRotationLock>(this));
274 if (tray_rotation_lock)
275 AddTrayItem(std::move(tray_rotation_lock));
276 tray_update_ = new TrayUpdate(this); 275 tray_update_ = new TrayUpdate(this);
277 AddTrayItem(base::WrapUnique(tray_update_)); 276 AddTrayItem(base::WrapUnique(tray_update_));
278 tray_tiles_ = new TrayTiles(this); 277 tray_tiles_ = new TrayTiles(this);
279 AddTrayItem(base::WrapUnique(tray_tiles_)); 278 AddTrayItem(base::WrapUnique(tray_tiles_));
280 tray_system_info_ = new TraySystemInfo(this); 279 tray_system_info_ = new TraySystemInfo(this);
281 AddTrayItem(base::WrapUnique(tray_system_info_)); 280 AddTrayItem(base::WrapUnique(tray_system_info_));
282 // Leading padding. 281 // Leading padding.
283 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); 282 AddTrayItem(base::MakeUnique<PaddingTrayItem>());
284 } 283 }
285 284
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 .work_area() 708 .work_area()
710 .height(); 709 .height();
711 if (work_area_height > 0) { 710 if (work_area_height > 0) {
712 UMA_HISTOGRAM_CUSTOM_COUNTS( 711 UMA_HISTOGRAM_CUSTOM_COUNTS(
713 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 712 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
714 100 * bubble_view->height() / work_area_height, 1, 300, 100); 713 100 * bubble_view->height() / work_area_height, 1, 300, 100);
715 } 714 }
716 } 715 }
717 716
718 } // namespace ash 717 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698