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

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

Issue 2923083002: chromeos: Convert system tray session length limit to mojo (Closed)
Patch Set: Created 3 years, 6 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
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
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 web_notification_tray_ = nullptr; 230 web_notification_tray_ = nullptr;
231 } 231 }
232 232
233 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { 233 void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
234 AddTrayItem(base::MakeUnique<TrayUser>(this)); 234 AddTrayItem(base::MakeUnique<TrayUser>(this));
235 235
236 // Crucially, this trailing padding has to be inside the user item(s). 236 // Crucially, this trailing padding has to be inside the user item(s).
237 // Otherwise it could be a main axis margin on the tray's box layout. 237 // Otherwise it could be a main axis margin on the tray's box layout.
238 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); 238 AddTrayItem(base::MakeUnique<PaddingTrayItem>());
239 239
240 AddTrayItem(base::MakeUnique<TraySessionLengthLimit>(this)); 240 tray_session_length_limit_ = new TraySessionLengthLimit(this);
241 AddTrayItem(base::WrapUnique(tray_session_length_limit_));
241 tray_enterprise_ = new TrayEnterprise(this); 242 tray_enterprise_ = new TrayEnterprise(this);
242 AddTrayItem(base::WrapUnique(tray_enterprise_)); 243 AddTrayItem(base::WrapUnique(tray_enterprise_));
243 tray_supervised_user_ = new TraySupervisedUser(this); 244 tray_supervised_user_ = new TraySupervisedUser(this);
244 AddTrayItem(base::WrapUnique(tray_supervised_user_)); 245 AddTrayItem(base::WrapUnique(tray_supervised_user_));
245 AddTrayItem(base::MakeUnique<TrayIME>(this)); 246 AddTrayItem(base::MakeUnique<TrayIME>(this));
246 tray_accessibility_ = new TrayAccessibility(this); 247 tray_accessibility_ = new TrayAccessibility(this);
247 AddTrayItem(base::WrapUnique(tray_accessibility_)); 248 AddTrayItem(base::WrapUnique(tray_accessibility_));
248 AddTrayItem(base::MakeUnique<TrayTracing>(this)); 249 AddTrayItem(base::MakeUnique<TrayTracing>(this));
249 AddTrayItem( 250 AddTrayItem(
250 base::MakeUnique<TrayPower>(this, message_center::MessageCenter::Get())); 251 base::MakeUnique<TrayPower>(this, message_center::MessageCenter::Get()));
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 594 }
594 595
595 TrayEnterprise* SystemTray::GetTrayEnterpriseForTesting() const { 596 TrayEnterprise* SystemTray::GetTrayEnterpriseForTesting() const {
596 return tray_enterprise_; 597 return tray_enterprise_;
597 } 598 }
598 599
599 TrayNetwork* SystemTray::GetTrayNetworkForTesting() const { 600 TrayNetwork* SystemTray::GetTrayNetworkForTesting() const {
600 return tray_network_; 601 return tray_network_;
601 } 602 }
602 603
604 TraySessionLengthLimit* SystemTray::GetTraySessionLengthLimitForTesting()
msw 2017/06/06 19:01:04 aside: these could all be simple accessors inlined
James Cook 2017/06/07 00:48:13 Acknowledged. I plan to introduce a testapi class,
605 const {
606 return tray_session_length_limit_;
607 }
608
603 TraySupervisedUser* SystemTray::GetTraySupervisedUserForTesting() const { 609 TraySupervisedUser* SystemTray::GetTraySupervisedUserForTesting() const {
604 return tray_supervised_user_; 610 return tray_supervised_user_;
605 } 611 }
606 612
607 TraySystemInfo* SystemTray::GetTraySystemInfoForTesting() const { 613 TraySystemInfo* SystemTray::GetTraySystemInfoForTesting() const {
608 return tray_system_info_; 614 return tray_system_info_;
609 } 615 }
610 616
611 TrayTiles* SystemTray::GetTrayTilesForTesting() const { 617 TrayTiles* SystemTray::GetTrayTilesForTesting() const {
612 return tray_tiles_; 618 return tray_tiles_;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 .work_area() 707 .work_area()
702 .height(); 708 .height();
703 if (work_area_height > 0) { 709 if (work_area_height > 0) {
704 UMA_HISTOGRAM_CUSTOM_COUNTS( 710 UMA_HISTOGRAM_CUSTOM_COUNTS(
705 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 711 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
706 100 * bubble_view->height() / work_area_height, 1, 300, 100); 712 100 * bubble_view->height() / work_area_height, 1, 300, 100);
707 } 713 }
708 } 714 }
709 715
710 } // namespace ash 716 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698