OLD | NEW |
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 #include <algorithm> | 8 #include <algorithm> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 (ash::PowerStatus::Get()->IsBatteryPresent() && | 478 (ash::PowerStatus::Get()->IsBatteryPresent() && |
479 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) { | 479 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) { |
480 return; | 480 return; |
481 } | 481 } |
482 content::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions")); | 482 content::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions")); |
483 ShowSettingsSubPageForActiveUser(chrome::kPowerOptionsSubPage); | 483 ShowSettingsSubPageForActiveUser(chrome::kPowerOptionsSubPage); |
484 } | 484 } |
485 | 485 |
486 void SystemTrayDelegateChromeOS::ShowChromeSlow() { | 486 void SystemTrayDelegateChromeOS::ShowChromeSlow() { |
487 chrome::ScopedTabbedBrowserDisplayer displayer( | 487 chrome::ScopedTabbedBrowserDisplayer displayer( |
488 ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 488 ProfileManager::GetPrimaryUserProfile()); |
489 chrome::ShowSlow(displayer.browser()); | 489 chrome::ShowSlow(displayer.browser()); |
490 } | 490 } |
491 | 491 |
492 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() { | 492 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() { |
493 // Packaged app is not counted as 'last active', so if a browser opening the | 493 // Packaged app is not counted as 'last active', so if a browser opening the |
494 // display settings is in background of a packaged app, it will return true. | 494 // display settings is in background of a packaged app, it will return true. |
495 // TODO(mukai): fix this. | 495 // TODO(mukai): fix this. |
496 Browser* active_browser = chrome::FindLastActive(); | 496 Browser* active_browser = chrome::FindLastActive(); |
497 if (!active_browser) | 497 if (!active_browser) |
498 return true; | 498 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
515 } | 515 } |
516 | 516 |
517 void SystemTrayDelegateChromeOS::ShowHelp() { | 517 void SystemTrayDelegateChromeOS::ShowHelp() { |
518 chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(), | 518 chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(), |
519 chrome::HOST_DESKTOP_TYPE_ASH, | 519 chrome::HOST_DESKTOP_TYPE_ASH, |
520 chrome::HELP_SOURCE_MENU); | 520 chrome::HELP_SOURCE_MENU); |
521 } | 521 } |
522 | 522 |
523 void SystemTrayDelegateChromeOS::ShowAccessibilityHelp() { | 523 void SystemTrayDelegateChromeOS::ShowAccessibilityHelp() { |
524 chrome::ScopedTabbedBrowserDisplayer displayer( | 524 chrome::ScopedTabbedBrowserDisplayer displayer( |
525 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 525 ProfileManager::GetActiveUserProfile()); |
526 accessibility::ShowAccessibilityHelp(displayer.browser()); | 526 accessibility::ShowAccessibilityHelp(displayer.browser()); |
527 } | 527 } |
528 | 528 |
529 void SystemTrayDelegateChromeOS::ShowAccessibilitySettings() { | 529 void SystemTrayDelegateChromeOS::ShowAccessibilitySettings() { |
530 content::RecordAction(base::UserMetricsAction("ShowAccessibilitySettings")); | 530 content::RecordAction(base::UserMetricsAction("ShowAccessibilitySettings")); |
531 std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + | 531 std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + |
532 l10n_util::GetStringUTF8( | 532 l10n_util::GetStringUTF8( |
533 IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY); | 533 IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY); |
534 ShowSettingsSubPageForActiveUser(sub_page); | 534 ShowSettingsSubPageForActiveUser(sub_page); |
535 } | 535 } |
536 | 536 |
537 void SystemTrayDelegateChromeOS::ShowPublicAccountInfo() { | 537 void SystemTrayDelegateChromeOS::ShowPublicAccountInfo() { |
538 chrome::ScopedTabbedBrowserDisplayer displayer( | 538 chrome::ScopedTabbedBrowserDisplayer displayer( |
539 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 539 ProfileManager::GetActiveUserProfile()); |
540 chrome::ShowPolicy(displayer.browser()); | 540 chrome::ShowPolicy(displayer.browser()); |
541 } | 541 } |
542 | 542 |
543 void SystemTrayDelegateChromeOS::ShowSupervisedUserInfo() { | 543 void SystemTrayDelegateChromeOS::ShowSupervisedUserInfo() { |
544 // TODO(antrim): find out what should we show in this case. | 544 // TODO(antrim): find out what should we show in this case. |
545 // http://crbug.com/229762 | 545 // http://crbug.com/229762 |
546 } | 546 } |
547 | 547 |
548 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() { | 548 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() { |
549 ash::user::LoginStatus status = GetUserLoginStatus(); | 549 ash::user::LoginStatus status = GetUserLoginStatus(); |
550 bool userAddingRunning = ash::Shell::GetInstance() | 550 bool userAddingRunning = ash::Shell::GetInstance() |
551 ->session_state_delegate() | 551 ->session_state_delegate() |
552 ->IsInSecondaryLoginScreen(); | 552 ->IsInSecondaryLoginScreen(); |
553 | 553 |
554 if (status == ash::user::LOGGED_IN_NONE || | 554 if (status == ash::user::LOGGED_IN_NONE || |
555 status == ash::user::LOGGED_IN_LOCKED || userAddingRunning) { | 555 status == ash::user::LOGGED_IN_LOCKED || userAddingRunning) { |
556 scoped_refptr<chromeos::HelpAppLauncher> help_app( | 556 scoped_refptr<chromeos::HelpAppLauncher> help_app( |
557 new chromeos::HelpAppLauncher(GetNativeWindow())); | 557 new chromeos::HelpAppLauncher(GetNativeWindow())); |
558 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); | 558 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); |
559 } else { | 559 } else { |
560 chrome::ScopedTabbedBrowserDisplayer displayer( | 560 chrome::ScopedTabbedBrowserDisplayer displayer( |
561 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 561 ProfileManager::GetActiveUserProfile()); |
562 chrome::ShowSingletonTab(displayer.browser(), | 562 chrome::ShowSingletonTab(displayer.browser(), |
563 GURL(chrome::kLearnMoreEnterpriseURL)); | 563 GURL(chrome::kLearnMoreEnterpriseURL)); |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 void SystemTrayDelegateChromeOS::ShowUserLogin() { | 567 void SystemTrayDelegateChromeOS::ShowUserLogin() { |
568 ash::Shell* shell = ash::Shell::GetInstance(); | 568 ash::Shell* shell = ash::Shell::GetInstance(); |
569 if (!shell->delegate()->IsMultiProfilesEnabled()) | 569 if (!shell->delegate()->IsMultiProfilesEnabled()) |
570 return; | 570 return; |
571 | 571 |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
1328 << "ENABLE_SUPERVISED_USERS undefined."; | 1328 << "ENABLE_SUPERVISED_USERS undefined."; |
1329 return base::string16(); | 1329 return base::string16(); |
1330 } | 1330 } |
1331 | 1331 |
1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1333 return new SystemTrayDelegateChromeOS(); | 1333 return new SystemTrayDelegateChromeOS(); |
1334 } | 1334 } |
1335 | 1335 |
1336 } // namespace chromeos | 1336 } // namespace chromeos |
OLD | NEW |