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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2377703003: Support SystemTrayDelegate::ShowPowerSettings() in mustash (Closed)
Patch Set: Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); 438 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog"));
439 ShowSettingsSubPageForActiveUser(page); 439 ShowSettingsSubPageForActiveUser(page);
440 } 440 }
441 } 441 }
442 442
443 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { 443 void SystemTrayDelegateChromeOS::ShowDisplaySettings() {
444 SystemTrayCommon::ShowDisplaySettings(); 444 SystemTrayCommon::ShowDisplaySettings();
445 } 445 }
446 446
447 void SystemTrayDelegateChromeOS::ShowPowerSettings() { 447 void SystemTrayDelegateChromeOS::ShowPowerSettings() {
448 // TODO(mash): Refactor out ash::PowerStatus and move to SystemTrayCommon. 448 SystemTrayCommon::ShowPowerSettings();
449 if (!(switches::PowerOverlayEnabled() ||
450 (ash::PowerStatus::Get()->IsBatteryPresent() &&
451 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) {
James Cook 2016/09/27 23:23:13 I didn't check SupportsDualRoleDevices() since thi
452 return;
453 }
454 content::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions"));
455 ShowSettingsSubPageForActiveUser(chrome::kPowerOptionsSubPage);
456 } 449 }
457 450
458 void SystemTrayDelegateChromeOS::ShowChromeSlow() { 451 void SystemTrayDelegateChromeOS::ShowChromeSlow() {
459 SystemTrayCommon::ShowChromeSlow(); 452 SystemTrayCommon::ShowChromeSlow();
460 } 453 }
461 454
462 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() { 455 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() {
463 // Packaged app is not counted as 'last active', so if a browser opening the 456 // Packaged app is not counted as 'last active', so if a browser opening the
464 // display settings is in background of a packaged app, it will return true. 457 // display settings is in background of a packaged app, it will return true.
465 // TODO(mukai): fix this. 458 // TODO(mukai): fix this.
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1292 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1300 << "ENABLE_SUPERVISED_USERS undefined."; 1293 << "ENABLE_SUPERVISED_USERS undefined.";
1301 return base::string16(); 1294 return base::string16();
1302 } 1295 }
1303 1296
1304 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1297 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1305 return new SystemTrayDelegateChromeOS(); 1298 return new SystemTrayDelegateChromeOS();
1306 } 1299 }
1307 1300
1308 } // namespace chromeos 1301 } // namespace chromeos
OLDNEW
« chrome/browser/ui/ash/system_tray_common.cc ('K') | « chrome/browser/ui/ash/system_tray_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698