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