| 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 "ash/common/system/tray/system_tray_controller.h" | 5 #include "ash/common/system/tray/system_tray_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/system/tray/system_tray_notifier.h" | 7 #include "ash/common/system/tray/system_tray_notifier.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "services/service_manager/public/cpp/connector.h" | 11 #include "services/service_manager/public/cpp/connector.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 SystemTrayController::SystemTrayController(shell::Connector* connector) | 15 SystemTrayController::SystemTrayController( |
| 16 service_manager::Connector* connector) |
| 16 : connector_(connector), hour_clock_type_(base::GetHourClockType()) {} | 17 : connector_(connector), hour_clock_type_(base::GetHourClockType()) {} |
| 17 | 18 |
| 18 SystemTrayController::~SystemTrayController() {} | 19 SystemTrayController::~SystemTrayController() {} |
| 19 | 20 |
| 20 void SystemTrayController::ShowSettings() { | 21 void SystemTrayController::ShowSettings() { |
| 21 if (ConnectToSystemTrayClient()) | 22 if (ConnectToSystemTrayClient()) |
| 22 system_tray_client_->ShowSettings(); | 23 system_tray_client_->ShowSettings(); |
| 23 } | 24 } |
| 24 | 25 |
| 25 void SystemTrayController::ShowDateSettings() { | 26 void SystemTrayController::ShowDateSettings() { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void SystemTrayController::OnClientConnectionError() { | 125 void SystemTrayController::OnClientConnectionError() { |
| 125 system_tray_client_.reset(); | 126 system_tray_client_.reset(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 void SystemTrayController::SetUse24HourClock(bool use_24_hour) { | 129 void SystemTrayController::SetUse24HourClock(bool use_24_hour) { |
| 129 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; | 130 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; |
| 130 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); | 131 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 } // namespace ash | 134 } // namespace ash |
| OLD | NEW |