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

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

Issue 2455513003: chromeos: Make enterprise help dialog work in mash, part 1 (Closed)
Patch Set: Created 4 years, 1 month 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 350
351 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() { 351 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() {
352 // TODO(mash): Refactor out SessionStateDelegate and move to SystemTrayClient. 352 // TODO(mash): Refactor out SessionStateDelegate and move to SystemTrayClient.
353 ash::LoginStatus status = GetUserLoginStatus(); 353 ash::LoginStatus status = GetUserLoginStatus();
354 ash::WmShell* wm_shell = ash::WmShell::Get(); 354 ash::WmShell* wm_shell = ash::WmShell::Get();
355 if (status == ash::LoginStatus::NOT_LOGGED_IN || 355 if (status == ash::LoginStatus::NOT_LOGGED_IN ||
356 status == ash::LoginStatus::LOCKED || 356 status == ash::LoginStatus::LOCKED ||
357 wm_shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) { 357 wm_shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) {
358 scoped_refptr<chromeos::HelpAppLauncher> help_app( 358 scoped_refptr<chromeos::HelpAppLauncher> help_app(
359 new chromeos::HelpAppLauncher(GetNativeWindow())); 359 new chromeos::HelpAppLauncher(nullptr /* parent_window */));
360 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); 360 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE);
361 } else { 361 } else {
362 chrome::ScopedTabbedBrowserDisplayer displayer( 362 chrome::ScopedTabbedBrowserDisplayer displayer(
363 ProfileManager::GetActiveUserProfile()); 363 ProfileManager::GetActiveUserProfile());
364 chrome::ShowSingletonTab(displayer.browser(), 364 chrome::ShowSingletonTab(displayer.browser(),
365 GURL(chrome::kLearnMoreEnterpriseURL)); 365 GURL(chrome::kLearnMoreEnterpriseURL));
366 } 366 }
367 } 367 }
368 368
369 void SystemTrayDelegateChromeOS::ShowUserLogin() { 369 void SystemTrayDelegateChromeOS::ShowUserLogin() {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 833
834 // Overridden from SessionManagerClient::Observer. 834 // Overridden from SessionManagerClient::Observer.
835 void SystemTrayDelegateChromeOS::ScreenIsLocked() { 835 void SystemTrayDelegateChromeOS::ScreenIsLocked() {
836 ash::WmShell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus()); 836 ash::WmShell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus());
837 } 837 }
838 838
839 void SystemTrayDelegateChromeOS::ScreenIsUnlocked() { 839 void SystemTrayDelegateChromeOS::ScreenIsUnlocked() {
840 ash::WmShell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus()); 840 ash::WmShell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus());
841 } 841 }
842 842
843 gfx::NativeWindow SystemTrayDelegateChromeOS::GetNativeWindow() const {
844 int container_id = SystemTrayClient::GetDialogParentContainerId();
845 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
846 container_id);
847 }
stevenjb 2016/10/26 19:39:07 Hooray!
848
849 // content::NotificationObserver implementation. 843 // content::NotificationObserver implementation.
850 void SystemTrayDelegateChromeOS::Observe( 844 void SystemTrayDelegateChromeOS::Observe(
851 int type, 845 int type,
852 const content::NotificationSource& source, 846 const content::NotificationSource& source,
853 const content::NotificationDetails& details) { 847 const content::NotificationDetails& details) {
854 switch (type) { 848 switch (type) {
855 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { 849 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: {
856 ash::UpdateInfo info; 850 ash::UpdateInfo info;
857 GetUpdateInfo(content::Source<UpgradeDetector>(source).ptr(), &info); 851 GetUpdateInfo(content::Source<UpgradeDetector>(source).ptr(), &info);
858 GetSystemTrayNotifier()->NotifyUpdateRecommended(info); 852 GetSystemTrayNotifier()->NotifyUpdateRecommended(info);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1102 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1109 << "ENABLE_SUPERVISED_USERS undefined."; 1103 << "ENABLE_SUPERVISED_USERS undefined.";
1110 return base::string16(); 1104 return base::string16();
1111 } 1105 }
1112 1106
1113 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1107 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1114 return new SystemTrayDelegateChromeOS(); 1108 return new SystemTrayDelegateChromeOS();
1115 } 1109 }
1116 1110
1117 } // namespace chromeos 1111 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698