| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 463 |
| 464 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { | 464 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { |
| 465 return clock_type_; | 465 return clock_type_; |
| 466 } | 466 } |
| 467 | 467 |
| 468 void SystemTrayDelegateChromeOS::ShowSettings() { | 468 void SystemTrayDelegateChromeOS::ShowSettings() { |
| 469 ShowSettingsSubPageForActiveUser(""); | 469 ShowSettingsSubPageForActiveUser(""); |
| 470 } | 470 } |
| 471 | 471 |
| 472 bool SystemTrayDelegateChromeOS::ShouldShowSettings() { | 472 bool SystemTrayDelegateChromeOS::ShouldShowSettings() { |
| 473 return UserManager::Get()->GetCurrentUserFlow()->ShouldShowSettings(); | 473 return UserManager::Get()->GetCurrentUserFlow()->ShouldShowSettings() && |
| 474 !ash::Shell::GetInstance() |
| 475 ->session_state_delegate() |
| 476 ->IsInSecondaryLoginScreen(); |
| 474 } | 477 } |
| 475 | 478 |
| 476 void SystemTrayDelegateChromeOS::ShowDateSettings() { | 479 void SystemTrayDelegateChromeOS::ShowDateSettings() { |
| 477 content::RecordAction(base::UserMetricsAction("ShowDateOptions")); | 480 content::RecordAction(base::UserMetricsAction("ShowDateOptions")); |
| 478 std::string sub_page = | 481 std::string sub_page = |
| 479 std::string(chrome::kSearchSubPage) + "#" + | 482 std::string(chrome::kSearchSubPage) + "#" + |
| 480 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); | 483 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); |
| 481 // Everybody can change the time zone (even though it is a device setting). | 484 // Everybody can change the time zone (even though it is a device setting). |
| 482 ShowSettingsSubPageForActiveUser(sub_page); | 485 ShowSettingsSubPageForActiveUser(sub_page); |
| 483 } | 486 } |
| 484 | 487 |
| 485 void SystemTrayDelegateChromeOS::ShowSetTimeDialog() { | 488 void SystemTrayDelegateChromeOS::ShowSetTimeDialog() { |
| 486 SetTimeDialog::ShowDialog(GetNativeWindow()); | 489 SetTimeDialog::ShowDialog(GetNativeWindow()); |
| 487 } | 490 } |
| 488 | 491 |
| 489 void SystemTrayDelegateChromeOS::ShowNetworkSettings( | 492 void SystemTrayDelegateChromeOS::ShowNetworkSettings( |
| 490 const std::string& service_path) { | 493 const std::string& service_path) { |
| 491 if (!LoginState::Get()->IsUserLoggedIn()) | 494 bool userAddingRunning = ash::Shell::GetInstance() |
| 495 ->session_state_delegate() |
| 496 ->IsInSecondaryLoginScreen(); |
| 497 |
| 498 if (!LoginState::Get()->IsUserLoggedIn() || userAddingRunning) |
| 492 return; | 499 return; |
| 493 ShowNetworkSettingsPage(service_path); | 500 ShowNetworkSettingsPage(service_path); |
| 494 } | 501 } |
| 495 | 502 |
| 496 void SystemTrayDelegateChromeOS::ShowBluetoothSettings() { | 503 void SystemTrayDelegateChromeOS::ShowBluetoothSettings() { |
| 497 // TODO(sad): Make this work. | 504 // TODO(sad): Make this work. |
| 498 } | 505 } |
| 499 | 506 |
| 500 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { | 507 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { |
| 501 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); | 508 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 chrome::ShowPolicy(displayer.browser()); | 580 chrome::ShowPolicy(displayer.browser()); |
| 574 } | 581 } |
| 575 | 582 |
| 576 void SystemTrayDelegateChromeOS::ShowSupervisedUserInfo() { | 583 void SystemTrayDelegateChromeOS::ShowSupervisedUserInfo() { |
| 577 // TODO(antrim): find out what should we show in this case. | 584 // TODO(antrim): find out what should we show in this case. |
| 578 // http://crbug.com/229762 | 585 // http://crbug.com/229762 |
| 579 } | 586 } |
| 580 | 587 |
| 581 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() { | 588 void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() { |
| 582 ash::user::LoginStatus status = GetUserLoginStatus(); | 589 ash::user::LoginStatus status = GetUserLoginStatus(); |
| 590 bool userAddingRunning = ash::Shell::GetInstance() |
| 591 ->session_state_delegate() |
| 592 ->IsInSecondaryLoginScreen(); |
| 593 |
| 583 if (status == ash::user::LOGGED_IN_NONE || | 594 if (status == ash::user::LOGGED_IN_NONE || |
| 584 status == ash::user::LOGGED_IN_LOCKED) { | 595 status == ash::user::LOGGED_IN_LOCKED || userAddingRunning) { |
| 585 scoped_refptr<chromeos::HelpAppLauncher> help_app( | 596 scoped_refptr<chromeos::HelpAppLauncher> help_app( |
| 586 new chromeos::HelpAppLauncher(GetNativeWindow())); | 597 new chromeos::HelpAppLauncher(GetNativeWindow())); |
| 587 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); | 598 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); |
| 588 } else { | 599 } else { |
| 589 chrome::ScopedTabbedBrowserDisplayer displayer( | 600 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 590 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 601 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); |
| 591 chrome::ShowSingletonTab(displayer.browser(), | 602 chrome::ShowSingletonTab(displayer.browser(), |
| 592 GURL(chrome::kLearnMoreEnterpriseURL)); | 603 GURL(chrome::kLearnMoreEnterpriseURL)); |
| 593 } | 604 } |
| 594 } | 605 } |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 accessibility_subscription_.reset(); | 1408 accessibility_subscription_.reset(); |
| 1398 else | 1409 else |
| 1399 OnAccessibilityModeChanged(details.notify); | 1410 OnAccessibilityModeChanged(details.notify); |
| 1400 } | 1411 } |
| 1401 | 1412 |
| 1402 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1413 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1403 return new SystemTrayDelegateChromeOS(); | 1414 return new SystemTrayDelegateChromeOS(); |
| 1404 } | 1415 } |
| 1405 | 1416 |
| 1406 } // namespace chromeos | 1417 } // namespace chromeos |
| OLD | NEW |