| 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_CONTROLLER_MUS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CONTROLLER_MUS_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 | 12 |
| 12 // Controls chrome's interaction with the ash system tray menu. | 13 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
| 13 class SystemTrayControllerMus : public chromeos::system::SystemClockObserver { | 14 // relevant state changes in chrome. |
| 15 class SystemTrayClient : public ash::mojom::SystemTrayClient, |
| 16 public chromeos::system::SystemClockObserver { |
| 14 public: | 17 public: |
| 15 SystemTrayControllerMus(); | 18 SystemTrayClient(); |
| 16 ~SystemTrayControllerMus() override; | 19 ~SystemTrayClient() override; |
| 20 |
| 21 static SystemTrayClient* Get(); |
| 17 | 22 |
| 18 private: | 23 private: |
| 24 // Connects or reconnects the |system_tray_| interface. |
| 25 void ConnectToSystemTray(); |
| 26 |
| 27 // Handles errors on the |system_tray_| interface connection. |
| 28 void OnClientConnectionError(); |
| 29 |
| 30 // ash::mojom::SystemTrayClient: |
| 31 void ShowDateSettings() override; |
| 32 |
| 19 // chromeos::system::SystemClockObserver: | 33 // chromeos::system::SystemClockObserver: |
| 20 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; | 34 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; |
| 21 | 35 |
| 36 // System tray mojo service in ash. |
| 22 ash::mojom::SystemTrayPtr system_tray_; | 37 ash::mojom::SystemTrayPtr system_tray_; |
| 23 | 38 |
| 24 DISALLOW_COPY_AND_ASSIGN(SystemTrayControllerMus); | 39 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); |
| 25 }; | 40 }; |
| 26 | 41 |
| 27 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CONTROLLER_MUS_H_ | 42 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| OLD | NEW |