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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 2857103007: [Night Light] CL2: Ash and system tray work (Closed)
Patch Set: Update comment 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 | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_item.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/shell_window_ids.h" 13 #include "ash/public/cpp/shell_window_ids.h"
14 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
15 #include "ash/session/session_controller.h" 15 #include "ash/session/session_controller.h"
16 #include "ash/shelf/wm_shelf.h" 16 #include "ash/shelf/wm_shelf.h"
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/shell_port.h" 18 #include "ash/shell_port.h"
19 #include "ash/strings/grit/ash_strings.h" 19 #include "ash/strings/grit/ash_strings.h"
20 #include "ash/system/audio/tray_audio.h" 20 #include "ash/system/audio/tray_audio.h"
21 #include "ash/system/bluetooth/tray_bluetooth.h" 21 #include "ash/system/bluetooth/tray_bluetooth.h"
22 #include "ash/system/brightness/tray_brightness.h" 22 #include "ash/system/brightness/tray_brightness.h"
23 #include "ash/system/cast/tray_cast.h" 23 #include "ash/system/cast/tray_cast.h"
24 #include "ash/system/date/tray_system_info.h" 24 #include "ash/system/date/tray_system_info.h"
25 #include "ash/system/enterprise/tray_enterprise.h" 25 #include "ash/system/enterprise/tray_enterprise.h"
26 #include "ash/system/ime/tray_ime_chromeos.h" 26 #include "ash/system/ime/tray_ime_chromeos.h"
27 #include "ash/system/media_security/multi_profile_media_tray_item.h" 27 #include "ash/system/media_security/multi_profile_media_tray_item.h"
28 #include "ash/system/network/tray_network.h" 28 #include "ash/system/network/tray_network.h"
29 #include "ash/system/network/tray_vpn.h" 29 #include "ash/system/network/tray_vpn.h"
30 #include "ash/system/night_light/tray_night_light.h"
30 #include "ash/system/power/power_status.h" 31 #include "ash/system/power/power_status.h"
31 #include "ash/system/power/tray_power.h" 32 #include "ash/system/power/tray_power.h"
32 #include "ash/system/screen_security/screen_capture_tray_item.h" 33 #include "ash/system/screen_security/screen_capture_tray_item.h"
33 #include "ash/system/screen_security/screen_share_tray_item.h" 34 #include "ash/system/screen_security/screen_share_tray_item.h"
34 #include "ash/system/session/tray_session_length_limit.h" 35 #include "ash/system/session/tray_session_length_limit.h"
35 #include "ash/system/supervised/tray_supervised_user.h" 36 #include "ash/system/supervised/tray_supervised_user.h"
36 #include "ash/system/tiles/tray_tiles.h" 37 #include "ash/system/tiles/tray_tiles.h"
37 #include "ash/system/tray/system_tray_controller.h" 38 #include "ash/system/tray/system_tray_controller.h"
38 #include "ash/system/tray/system_tray_delegate.h" 39 #include "ash/system/tray/system_tray_delegate.h"
39 #include "ash/system/tray/system_tray_item.h" 40 #include "ash/system/tray/system_tray_item.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 AddTrayItem(base::WrapUnique(tray_cast_)); 267 AddTrayItem(base::WrapUnique(tray_cast_));
267 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); 268 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this);
268 AddTrayItem(base::WrapUnique(screen_capture_tray_item_)); 269 AddTrayItem(base::WrapUnique(screen_capture_tray_item_));
269 screen_share_tray_item_ = new ScreenShareTrayItem(this); 270 screen_share_tray_item_ = new ScreenShareTrayItem(this);
270 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); 271 AddTrayItem(base::WrapUnique(screen_share_tray_item_));
271 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); 272 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this));
272 tray_audio_ = new TrayAudio(this); 273 tray_audio_ = new TrayAudio(this);
273 AddTrayItem(base::WrapUnique(tray_audio_)); 274 AddTrayItem(base::WrapUnique(tray_audio_));
274 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); 275 AddTrayItem(base::MakeUnique<TrayBrightness>(this));
275 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); 276 AddTrayItem(base::MakeUnique<TrayCapsLock>(this));
277 tray_night_light_ = new TrayNightLight(this);
278 AddTrayItem(base::WrapUnique(tray_night_light_));
276 // TODO(jamescook): Remove this when mus has support for display management 279 // TODO(jamescook): Remove this when mus has support for display management
277 // and we have a DisplayManager equivalent. See http://crbug.com/548429 280 // and we have a DisplayManager equivalent. See http://crbug.com/548429
278 std::unique_ptr<SystemTrayItem> tray_rotation_lock = 281 std::unique_ptr<SystemTrayItem> tray_rotation_lock =
279 delegate->CreateRotationLockTrayItem(this); 282 delegate->CreateRotationLockTrayItem(this);
280 if (tray_rotation_lock) 283 if (tray_rotation_lock)
281 AddTrayItem(std::move(tray_rotation_lock)); 284 AddTrayItem(std::move(tray_rotation_lock));
282 tray_update_ = new TrayUpdate(this); 285 tray_update_ = new TrayUpdate(this);
283 AddTrayItem(base::WrapUnique(tray_update_)); 286 AddTrayItem(base::WrapUnique(tray_update_));
284 tray_tiles_ = new TrayTiles(this); 287 tray_tiles_ = new TrayTiles(this);
285 AddTrayItem(base::WrapUnique(tray_tiles_)); 288 AddTrayItem(base::WrapUnique(tray_tiles_));
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 .work_area() 717 .work_area()
715 .height(); 718 .height();
716 if (work_area_height > 0) { 719 if (work_area_height > 0) {
717 UMA_HISTOGRAM_CUSTOM_COUNTS( 720 UMA_HISTOGRAM_CUSTOM_COUNTS(
718 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 721 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
719 100 * bubble_view->height() / work_area_height, 1, 300, 100); 722 100 * bubble_view->height() / work_area_height, 1, 300, 100);
720 } 723 }
721 } 724 }
722 725
723 } // namespace ash 726 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698