| 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 #ifndef ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ | 5 #ifndef ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ |
| 6 #define ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ | 6 #define ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ |
| 7 | 7 |
| 8 #include "ash/common/system/tray/default_system_tray_delegate.h" | 8 #include "ash/common/system/tray/default_system_tray_delegate.h" |
| 9 #include "ash/public/interfaces/system_tray.mojom.h" | 9 #include "ash/public/interfaces/system_tray.mojom.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 | 12 |
| 13 namespace shell { |
| 14 class Connector; |
| 15 } |
| 16 |
| 13 namespace ash { | 17 namespace ash { |
| 14 | 18 |
| 15 // Handles the settings displayed in the system tray menu. For mus most settings | 19 // Handles the settings displayed in the system tray menu. For mus most settings |
| 16 // are obtained from chrome browser via mojo IPC. For the classic ash version | 20 // are obtained from chrome browser via mojo IPC. For the classic ash version |
| 17 // see SystemTrayDelegateChromeOS. | 21 // see SystemTrayDelegateChromeOS. |
| 18 // | 22 // |
| 19 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. | 23 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. |
| 20 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate, | 24 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate, |
| 21 public mojom::SystemTray { | 25 public mojom::SystemTray { |
| 22 public: | 26 public: |
| 23 SystemTrayDelegateMus(); | 27 explicit SystemTrayDelegateMus(shell::Connector* connector); |
| 24 ~SystemTrayDelegateMus() override; | 28 ~SystemTrayDelegateMus() override; |
| 25 | 29 |
| 26 static SystemTrayDelegateMus* Get(); | 30 static SystemTrayDelegateMus* Get(); |
| 27 | 31 |
| 28 private: | 32 private: |
| 33 // Connects or reconnects the |system_tray_client_| interface. |
| 34 void ConnectToSystemTrayClient(); |
| 35 |
| 36 // Handles errors on the |system_tray_client_| interface connection. |
| 37 void OnClientConnectionError(); |
| 38 |
| 29 // SystemTrayDelegate: | 39 // SystemTrayDelegate: |
| 30 base::HourClockType GetHourClockType() const override; | 40 base::HourClockType GetHourClockType() const override; |
| 41 void ShowDateSettings() override; |
| 31 | 42 |
| 32 // mojom::SystemTray: | 43 // mojom::SystemTray: |
| 33 void SetUse24HourClock(bool use_24_hour) override; | 44 void SetUse24HourClock(bool use_24_hour) override; |
| 34 | 45 |
| 46 // May be null in unit tests. |
| 47 shell::Connector* connector_; |
| 48 |
| 49 // Client interface in chrome browser. |
| 50 mojom::SystemTrayClientPtr system_tray_client_; |
| 51 |
| 35 // 12 or 24 hour display. | 52 // 12 or 24 hour display. |
| 36 base::HourClockType hour_clock_type_; | 53 base::HourClockType hour_clock_type_; |
| 37 | 54 |
| 38 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); | 55 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); |
| 39 }; | 56 }; |
| 40 | 57 |
| 41 } // namespace ash | 58 } // namespace ash |
| 42 | 59 |
| 43 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ | 60 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ |
| OLD | NEW |