| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_client.h" | 5 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 6 | 6 |
| 7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/browser_process_platform_part.h" | 14 #include "chrome/browser/browser_process_platform_part.h" |
| 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 16 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 16 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 17 #include "chrome/browser/chromeos/options/network_config_view.h" | 17 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 19 #include "chrome/browser/chromeos/set_time_dialog.h" | 19 #include "chrome/browser/chromeos/set_time_dialog.h" |
| 20 #include "chrome/browser/chromeos/system/system_clock.h" | 20 #include "chrome/browser/chromeos/system/system_clock.h" |
| 21 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" | 21 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" |
| 22 #include "chrome/browser/lifetime/application_lifetime.h" | 22 #include "chrome/browser/lifetime/application_lifetime.h" |
| 23 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| 24 #include "chrome/browser/ui/ash/ash_util.h" | 24 #include "chrome/browser/ui/ash/ash_util.h" |
| 25 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 25 #include "chrome/browser/ui/chrome_pages.h" | 26 #include "chrome/browser/ui/chrome_pages.h" |
| 26 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 27 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 27 #include "chrome/browser/ui/singleton_tabs.h" | 28 #include "chrome/browser/ui/singleton_tabs.h" |
| 28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 29 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "chromeos/dbus/session_manager_client.h" | 31 #include "chromeos/dbus/session_manager_client.h" |
| 31 #include "chromeos/login/login_state.h" | 32 #include "chromeos/login/login_state.h" |
| 32 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
| 33 #include "content/public/browser/user_metrics.h" | 34 #include "content/public/browser/user_metrics.h" |
| 34 #include "content/public/common/service_manager_connection.h" | 35 #include "content/public/common/service_manager_connection.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 CHECK(!login_state->IsUserLoggedIn() || | 310 CHECK(!login_state->IsUserLoggedIn() || |
| 310 login_state->GetLoggedInUserType() == LoginState::LOGGED_IN_USER_NONE); | 311 login_state->GetLoggedInUserType() == LoginState::LOGGED_IN_USER_NONE); |
| 311 chromeos::LoginDisplayHost::default_host()->OpenProxySettings(); | 312 chromeos::LoginDisplayHost::default_host()->OpenProxySettings(); |
| 312 } | 313 } |
| 313 | 314 |
| 314 void SystemTrayClient::SignOut() { | 315 void SystemTrayClient::SignOut() { |
| 315 chrome::AttemptUserExit(); | 316 chrome::AttemptUserExit(); |
| 316 } | 317 } |
| 317 | 318 |
| 318 void SystemTrayClient::RequestRestartForUpdate() { | 319 void SystemTrayClient::RequestRestartForUpdate() { |
| 319 // We expect that UpdateEngine is in "Reboot for update" state now. | 320 bool component_update = false; |
| 320 chrome::NotifyAndTerminate(true /* fast_path */); | 321 chromeos::SystemTrayDelegateChromeOS* tray = |
| 322 chromeos::SystemTrayDelegateChromeOS::Get(); |
| 323 if (tray) |
| 324 component_update = tray->GetFlashUpdateAvailable(); |
| 325 |
| 326 chrome::NotifyAndTerminate(true /* fast_path */, component_update); |
| 321 } | 327 } |
| 322 | 328 |
| 323 //////////////////////////////////////////////////////////////////////////////// | 329 //////////////////////////////////////////////////////////////////////////////// |
| 324 // chromeos::system::SystemClockObserver: | 330 // chromeos::system::SystemClockObserver: |
| 325 | 331 |
| 326 void SystemTrayClient::OnSystemClockChanged( | 332 void SystemTrayClient::OnSystemClockChanged( |
| 327 chromeos::system::SystemClock* clock) { | 333 chromeos::system::SystemClock* clock) { |
| 328 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); | 334 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); |
| 329 } | 335 } |
| OLD | NEW |