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" | 11 #include "ash/public/interfaces/system_tray.mojom.h" |
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 | 14 |
15 namespace shell { | 15 namespace shell { |
16 class Connector; | 16 class Connector; |
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
17 } | 17 } |
18 | 18 |
19 namespace ash { | 19 namespace ash { |
20 | 20 |
21 class NetworkingConfigDelegate; | 21 class NetworkingConfigDelegate; |
22 class VPNDelegate; | 22 class VPNDelegate; |
23 | 23 |
24 // Handles the settings displayed in the system tray menu. For mus most settings | 24 // 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 | 25 // version see SystemTrayDelegateChromeOS. |
26 // see SystemTrayDelegateChromeOS. | |
27 // | 26 // |
28 // Chrome OS only. Other platforms use DefaultSystemTrayDelegate directly. | 27 // Chrome OS only. Other platforms use DefaultSystemTrayDelegate directly. |
29 // | 28 // |
30 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. | 29 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. |
31 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate, | 30 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate { |
32 public mojom::SystemTray { | |
33 public: | 31 public: |
34 explicit SystemTrayDelegateMus(shell::Connector* connector); | 32 SystemTrayDelegateMus(); |
35 ~SystemTrayDelegateMus() override; | 33 ~SystemTrayDelegateMus() override; |
36 | 34 |
37 static SystemTrayDelegateMus* Get(); | |
38 | |
39 private: | 35 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: | 36 // 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; | 37 NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; |
65 VPNDelegate* GetVPNDelegate() const override; | 38 VPNDelegate* GetVPNDelegate() const override; |
66 | 39 |
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_; | 40 std::unique_ptr<NetworkingConfigDelegate> networking_config_delegate_; |
80 std::unique_ptr<VPNDelegate> vpn_delegate_; | 41 std::unique_ptr<VPNDelegate> vpn_delegate_; |
81 | 42 |
82 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); | 43 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); |
83 }; | 44 }; |
84 | 45 |
85 } // namespace ash | 46 } // namespace ash |
86 | 47 |
87 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ | 48 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ |
OLD | NEW |