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

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

Issue 2148943002: mash: Create system tray display and rotation lock items via delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 15 matching lines...) Expand all
26 #include "ash/common/system/ime/ime_observer.h" 26 #include "ash/common/system/ime/ime_observer.h"
27 #include "ash/common/system/tray/system_tray_delegate.h" 27 #include "ash/common/system/tray/system_tray_delegate.h"
28 #include "ash/common/system/tray/system_tray_notifier.h" 28 #include "ash/common/system/tray/system_tray_notifier.h"
29 #include "ash/common/system/tray_accessibility.h" 29 #include "ash/common/system/tray_accessibility.h"
30 #include "ash/common/system/update/update_observer.h" 30 #include "ash/common/system/update/update_observer.h"
31 #include "ash/common/system/user/user_observer.h" 31 #include "ash/common/system/user/user_observer.h"
32 #include "ash/common/system/volume_control_delegate.h" 32 #include "ash/common/system/volume_control_delegate.h"
33 #include "ash/common/wm_shell.h" 33 #include "ash/common/wm_shell.h"
34 #include "ash/desktop_background/desktop_background_controller.h" 34 #include "ash/desktop_background/desktop_background_controller.h"
35 #include "ash/shell.h" 35 #include "ash/shell.h"
36 #include "ash/system/chromeos/tray_display.h"
36 #include "ash/system/tray/system_tray.h" 37 #include "ash/system/tray/system_tray.h"
37 #include "ash/wm/lock_state_controller.h" 38 #include "ash/wm/lock_state_controller.h"
38 #include "base/bind_helpers.h" 39 #include "base/bind_helpers.h"
39 #include "base/callback.h" 40 #include "base/callback.h"
40 #include "base/logging.h" 41 #include "base/logging.h"
41 #include "base/memory/ptr_util.h" 42 #include "base/memory/ptr_util.h"
42 #include "base/memory/weak_ptr.h" 43 #include "base/memory/weak_ptr.h"
43 #include "base/strings/stringprintf.h" 44 #include "base/strings/stringprintf.h"
44 #include "base/strings/utf_string_conversions.h" 45 #include "base/strings/utf_string_conversions.h"
45 #include "base/sys_info.h" 46 #include "base/sys_info.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 if (LoginState::Get()->IsUserLoggedIn() && 447 if (LoginState::Get()->IsUserLoggedIn() &&
447 !wm_shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) { 448 !wm_shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) {
448 std::string page = chrome::kInternetOptionsSubPage; 449 std::string page = chrome::kInternetOptionsSubPage;
449 if (!guid.empty()) 450 if (!guid.empty())
450 page += "?guid=" + net::EscapeUrlEncodedData(guid, true); 451 page += "?guid=" + net::EscapeUrlEncodedData(guid, true);
451 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); 452 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog"));
452 ShowSettingsSubPageForActiveUser(page); 453 ShowSettingsSubPageForActiveUser(page);
453 } 454 }
454 } 455 }
455 456
457 std::unique_ptr<ash::SystemTrayItem>
458 SystemTrayDelegateChromeOS::CreateDisplayTrayItem(ash::SystemTray* tray) {
459 return base::WrapUnique(new ash::TrayDisplay(tray));
msw 2016/07/13 18:51:49 nit: MakeUnique
James Cook 2016/07/13 21:30:46 Done.
460 }
461
456 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { 462 void SystemTrayDelegateChromeOS::ShowDisplaySettings() {
457 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); 463 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions"));
458 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); 464 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName);
459 } 465 }
460 466
461 void SystemTrayDelegateChromeOS::ShowPowerSettings() { 467 void SystemTrayDelegateChromeOS::ShowPowerSettings() {
462 if (!(switches::PowerOverlayEnabled() || 468 if (!(switches::PowerOverlayEnabled() ||
463 (ash::PowerStatus::Get()->IsBatteryPresent() && 469 (ash::PowerStatus::Get()->IsBatteryPresent() &&
464 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) { 470 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) {
465 return; 471 return;
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1322 << "ENABLE_SUPERVISED_USERS undefined."; 1328 << "ENABLE_SUPERVISED_USERS undefined.";
1323 return base::string16(); 1329 return base::string16();
1324 } 1330 }
1325 1331
1326 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1327 return new SystemTrayDelegateChromeOS(); 1333 return new SystemTrayDelegateChromeOS();
1328 } 1334 }
1329 1335
1330 } // namespace chromeos 1336 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698