| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/system/tray/default_system_tray_delegate.h" | 10 #include "ash/common/system/tray/default_system_tray_delegate.h" |
| 11 #include "ash/public/interfaces/system_tray.mojom.h" | |
| 12 #include "base/i18n/time_formatting.h" | |
| 13 #include "base/macros.h" | 11 #include "base/macros.h" |
| 14 | 12 |
| 15 namespace shell { | |
| 16 class Connector; | |
| 17 } | |
| 18 | |
| 19 namespace ash { | 13 namespace ash { |
| 20 | 14 |
| 21 class NetworkingConfigDelegate; | 15 class NetworkingConfigDelegate; |
| 22 class VPNDelegate; | 16 class VPNDelegate; |
| 23 | 17 |
| 24 // Handles the settings displayed in the system tray menu. For mus most settings | 18 // Handles the settings displayed in the system tray menu. For the classic ash |
| 25 // are obtained from chrome browser via mojo IPC. For the classic ash version | 19 // version see SystemTrayDelegateChromeOS. |
| 26 // see SystemTrayDelegateChromeOS. | |
| 27 // | 20 // |
| 28 // Chrome OS only. Other platforms use DefaultSystemTrayDelegate directly. | 21 // Chrome OS only. Other platforms use DefaultSystemTrayDelegate directly. |
| 29 // | 22 // |
| 30 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. | 23 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. |
| 31 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate, | 24 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate { |
| 32 public mojom::SystemTray { | |
| 33 public: | 25 public: |
| 34 explicit SystemTrayDelegateMus(shell::Connector* connector); | 26 SystemTrayDelegateMus(); |
| 35 ~SystemTrayDelegateMus() override; | 27 ~SystemTrayDelegateMus() override; |
| 36 | 28 |
| 37 static SystemTrayDelegateMus* Get(); | |
| 38 | |
| 39 private: | 29 private: |
| 40 // Connects or reconnects to the mojom::SystemTrayClient interface and returns | |
| 41 // the interface pointer. | |
| 42 mojom::SystemTrayClient* ConnectToSystemTrayClient(); | |
| 43 | |
| 44 // Handles errors on the |system_tray_client_| interface connection. | |
| 45 void OnClientConnectionError(); | |
| 46 | |
| 47 // SystemTrayDelegate: | 30 // SystemTrayDelegate: |
| 48 base::HourClockType GetHourClockType() const override; | |
| 49 void ShowSettings() override; | |
| 50 void ShowDateSettings() override; | |
| 51 void ShowNetworkSettingsForGuid(const std::string& guid) override; | |
| 52 void ShowDisplaySettings() override; | |
| 53 void ShowPowerSettings() override; | |
| 54 void ShowChromeSlow() override; | |
| 55 void ShowIMESettings() override; | |
| 56 void ShowHelp() override; | |
| 57 void ShowAccessibilityHelp() override; | |
| 58 void ShowAccessibilitySettings() override; | |
| 59 void ShowPaletteHelp() override; | |
| 60 void ShowPaletteSettings() override; | |
| 61 void ShowPublicAccountInfo() override; | |
| 62 void ShowEnterpriseInfo() override; | |
| 63 void ShowProxySettings() override; | |
| 64 NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; | 31 NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; |
| 65 VPNDelegate* GetVPNDelegate() const override; | 32 VPNDelegate* GetVPNDelegate() const override; |
| 66 | 33 |
| 67 // mojom::SystemTray: | |
| 68 void SetUse24HourClock(bool use_24_hour) override; | |
| 69 | |
| 70 // May be null in unit tests. | |
| 71 shell::Connector* connector_; | |
| 72 | |
| 73 // Client interface in chrome browser. | |
| 74 mojom::SystemTrayClientPtr system_tray_client_; | |
| 75 | |
| 76 // 12 or 24 hour display. | |
| 77 base::HourClockType hour_clock_type_; | |
| 78 | |
| 79 std::unique_ptr<NetworkingConfigDelegate> networking_config_delegate_; | 34 std::unique_ptr<NetworkingConfigDelegate> networking_config_delegate_; |
| 80 std::unique_ptr<VPNDelegate> vpn_delegate_; | 35 std::unique_ptr<VPNDelegate> vpn_delegate_; |
| 81 | 36 |
| 82 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); | 37 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); |
| 83 }; | 38 }; |
| 84 | 39 |
| 85 } // namespace ash | 40 } // namespace ash |
| 86 | 41 |
| 87 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ | 42 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ |
| OLD | NEW |