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

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

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback Created 6 years, 8 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 | Annotate | Revision Log
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 <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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698