| 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 CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| 7 | 7 |
| 8 #include "ash/public/interfaces/system_tray.mojom.h" | 8 #include "ash/public/interfaces/system_tray.mojom.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/chromeos/system/system_clock_observer.h" | 10 #include "chrome/browser/chromeos/system/system_clock_observer.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 12 |
| 13 // Handles method calls delegated back to chrome from ash. Also notifies ash of | 13 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
| 14 // relevant state changes in chrome. | 14 // relevant state changes in chrome. |
| 15 // TODO: Consider renaming this to SystemTrayClientChromeOS. | 15 // TODO: Consider renaming this to SystemTrayClientChromeOS. |
| 16 class SystemTrayClient : public ash::mojom::SystemTrayClient, | 16 class SystemTrayClient : public ash::mojom::SystemTrayClient, |
| 17 public chromeos::system::SystemClockObserver { | 17 public chromeos::system::SystemClockObserver { |
| 18 public: | 18 public: |
| 19 static const char kDisplaySettingsSubPageName[]; | 19 static const char kDisplaySettingsSubPageName[]; |
| 20 static const char kDisplayOverscanSettingsSubPageName[]; | 20 static const char kDisplayOverscanSettingsSubPageName[]; |
| 21 | 21 |
| 22 SystemTrayClient(); | 22 SystemTrayClient(); |
| 23 ~SystemTrayClient() override; | 23 ~SystemTrayClient() override; |
| 24 | 24 |
| 25 static SystemTrayClient* Get(); | 25 static SystemTrayClient* Get(); |
| 26 | 26 |
| 27 private: | |
| 28 // Connects or reconnects the |system_tray_| interface. | |
| 29 void ConnectToSystemTray(); | |
| 30 | |
| 31 // Handles errors on the |system_tray_| interface connection. | |
| 32 void OnClientConnectionError(); | |
| 33 | |
| 34 // ash::mojom::SystemTrayClient: | 27 // ash::mojom::SystemTrayClient: |
| 35 void ShowSettings() override; | 28 void ShowSettings() override; |
| 36 void ShowDateSettings() override; | 29 void ShowDateSettings() override; |
| 37 void ShowDisplaySettings() override; | 30 void ShowDisplaySettings() override; |
| 38 void ShowPowerSettings() override; | 31 void ShowPowerSettings() override; |
| 39 void ShowChromeSlow() override; | 32 void ShowChromeSlow() override; |
| 40 void ShowIMESettings() override; | 33 void ShowIMESettings() override; |
| 41 void ShowHelp() override; | 34 void ShowHelp() override; |
| 42 void ShowAccessibilityHelp() override; | 35 void ShowAccessibilityHelp() override; |
| 43 void ShowAccessibilitySettings() override; | 36 void ShowAccessibilitySettings() override; |
| 44 void ShowPaletteHelp() override; | 37 void ShowPaletteHelp() override; |
| 45 void ShowPaletteSettings() override; | 38 void ShowPaletteSettings() override; |
| 46 void ShowPublicAccountInfo() override; | 39 void ShowPublicAccountInfo() override; |
| 40 void ShowNetworkSettings(const std::string& network_id) override; |
| 47 void ShowProxySettings() override; | 41 void ShowProxySettings() override; |
| 48 | 42 |
| 43 private: |
| 49 // chromeos::system::SystemClockObserver: | 44 // chromeos::system::SystemClockObserver: |
| 50 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; | 45 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; |
| 51 | 46 |
| 47 // Connects or reconnects the |system_tray_| interface. |
| 48 void ConnectToSystemTray(); |
| 49 |
| 50 // Handles errors on the |system_tray_| interface connection. |
| 51 void OnClientConnectionError(); |
| 52 |
| 52 // System tray mojo service in ash. | 53 // System tray mojo service in ash. |
| 53 ash::mojom::SystemTrayPtr system_tray_; | 54 ash::mojom::SystemTrayPtr system_tray_; |
| 54 | 55 |
| 55 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); | 56 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 59 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| OLD | NEW |