| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "chrome/browser/chromeos/login/login_wizard.h" | 60 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 61 #include "chrome/browser/chromeos/login/supervised_user_manager.h" | 61 #include "chrome/browser/chromeos/login/supervised_user_manager.h" |
| 62 #include "chrome/browser/chromeos/login/user.h" | 62 #include "chrome/browser/chromeos/login/user.h" |
| 63 #include "chrome/browser/chromeos/login/user_adding_screen.h" | 63 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
| 64 #include "chrome/browser/chromeos/login/user_manager.h" | 64 #include "chrome/browser/chromeos/login/user_manager.h" |
| 65 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 65 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 66 #include "chrome/browser/chromeos/options/network_config_view.h" | 66 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 67 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 67 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 68 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 68 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 69 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 69 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
| 70 #include "chrome/browser/chromeos/set_time_dialog.h" |
| 70 #include "chrome/browser/chromeos/settings/cros_settings.h" | 71 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 71 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 72 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
| 72 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" | 73 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" |
| 73 #include "chrome/browser/drive/drive_service_interface.h" | 74 #include "chrome/browser/drive/drive_service_interface.h" |
| 74 #include "chrome/browser/feedback/tracing_manager.h" | 75 #include "chrome/browser/feedback/tracing_manager.h" |
| 75 #include "chrome/browser/google/google_util.h" | 76 #include "chrome/browser/google/google_util.h" |
| 76 #include "chrome/browser/lifetime/application_lifetime.h" | 77 #include "chrome/browser/lifetime/application_lifetime.h" |
| 77 #include "chrome/browser/profiles/profile_manager.h" | 78 #include "chrome/browser/profiles/profile_manager.h" |
| 78 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 79 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 79 #include "chrome/browser/ui/ash/stub_user_accounts_delegate.h" | 80 #include "chrome/browser/ui/ash/stub_user_accounts_delegate.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 void SystemTrayDelegateChromeOS::ShowSettings() { | 468 void SystemTrayDelegateChromeOS::ShowSettings() { |
| 468 ShowSettingsSubPageForActiveUser(""); | 469 ShowSettingsSubPageForActiveUser(""); |
| 469 } | 470 } |
| 470 | 471 |
| 471 bool SystemTrayDelegateChromeOS::ShouldShowSettings() { | 472 bool SystemTrayDelegateChromeOS::ShouldShowSettings() { |
| 472 return UserManager::Get()->GetCurrentUserFlow()->ShouldShowSettings(); | 473 return UserManager::Get()->GetCurrentUserFlow()->ShouldShowSettings(); |
| 473 } | 474 } |
| 474 | 475 |
| 475 void SystemTrayDelegateChromeOS::ShowDateSettings() { | 476 void SystemTrayDelegateChromeOS::ShowDateSettings() { |
| 476 content::RecordAction(base::UserMetricsAction("ShowDateOptions")); | 477 content::RecordAction(base::UserMetricsAction("ShowDateOptions")); |
| 478 |
| 479 // Everybody can change the time zone (even though it is a device setting). |
| 480 ash::user::LoginStatus login_status = GetUserLoginStatus(); |
| 481 if (login_status == ash::user::LOGGED_IN_LOCKED || |
| 482 login_status == ash::user::LOGGED_IN_NONE) { |
| 483 SetTimeDialog::ShowDialog(GetNativeWindow()); |
| 484 return; |
| 485 } |
| 486 |
| 477 std::string sub_page = | 487 std::string sub_page = |
| 478 std::string(chrome::kSearchSubPage) + "#" + | 488 std::string(chrome::kSearchSubPage) + "#" + |
| 479 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); | 489 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); |
| 480 // Everybody can change the time zone (even though it is a device setting). | |
| 481 ShowSettingsSubPageForActiveUser(sub_page); | 490 ShowSettingsSubPageForActiveUser(sub_page); |
| 482 } | 491 } |
| 483 | 492 |
| 484 void SystemTrayDelegateChromeOS::ShowNetworkSettings( | 493 void SystemTrayDelegateChromeOS::ShowNetworkSettings( |
| 485 const std::string& service_path) { | 494 const std::string& service_path) { |
| 486 if (!LoginState::Get()->IsUserLoggedIn()) | 495 if (!LoginState::Get()->IsUserLoggedIn()) |
| 487 return; | 496 return; |
| 488 ShowNetworkSettingsPage(service_path); | 497 ShowNetworkSettingsPage(service_path); |
| 489 } | 498 } |
| 490 | 499 |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 accessibility_subscription_.reset(); | 1420 accessibility_subscription_.reset(); |
| 1412 else | 1421 else |
| 1413 OnAccessibilityModeChanged(details.notify); | 1422 OnAccessibilityModeChanged(details.notify); |
| 1414 } | 1423 } |
| 1415 | 1424 |
| 1416 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1425 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1417 return new SystemTrayDelegateChromeOS(); | 1426 return new SystemTrayDelegateChromeOS(); |
| 1418 } | 1427 } |
| 1419 | 1428 |
| 1420 } // namespace chromeos | 1429 } // namespace chromeos |
| OLD | NEW |