Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Side by Side Diff: chrome/browser/ui/ash/system_tray_client.h

Issue 2360143004: mash: Add SystemTrayClient interface, use to show date settings (Closed)
Patch Set: format Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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,
James Cook 2016/09/24 00:34:37 I combined the chrome -> ash and ash -> chrome com
sky 2016/09/26 15:23:14 I actually prefer an explicit SetClient as it mean
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 // Binds the SystemTrayClient mojo interface to this object.
40 mojo::Binding<ash::mojom::SystemTrayClient> binding_;
41
42 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient);
25 }; 43 };
26 44
27 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CONTROLLER_MUS_H_ 45 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698