OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CHROMEOS_DBUS_METRONOME_CLIENT_H_ | |
6 #define CHROMEOS_DBUS_METRONOME_CLIENT_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/callback_forward.h" | |
10 #include "chromeos/dbus/dbus_client.h" | |
11 #include "chromeos/dbus/dbus_client_implementation_type.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 // A DBus client class for the org.chromium.Metronome service. | |
16 class MetronomeClient : public DBusClient { | |
17 public: | |
18 // Interface for observing timestamp events from a metronome client. | |
19 class Observer { | |
20 public: | |
21 // Called when the TimestampUpdated signal is received. | |
22 virtual void OnTimestampUpdated(uint64 beacon_timestamp, | |
23 uint64 local_timestamp) = 0; | |
stevenjb
2015/02/24 18:34:50
Needs a virtual destructor (can be inlined).
varkha
2015/02/24 22:28:42
Done.
| |
24 }; | |
25 | |
26 virtual ~MetronomeClient(); | |
27 | |
28 // Adds and removes observers for timestamp events. | |
29 virtual void AddObserver(Observer* observer) = 0; | |
30 virtual void RemoveObserver(Observer* observer) = 0; | |
31 | |
32 // Factory function, creates a new instance and returns ownership. | |
33 // For normal usage, access the singleton via DBusThreadManager::Get(). | |
34 static MetronomeClient* Create(DBusClientImplementationType type); | |
35 | |
36 protected: | |
37 // Create() should be used instead. | |
38 MetronomeClient(); | |
39 | |
40 private: | |
41 DISALLOW_COPY_AND_ASSIGN(MetronomeClient); | |
42 }; | |
43 | |
44 } // namespace chromeos | |
45 | |
46 #endif // CHROMEOS_DBUS_METRONOME_CLIENT_H_ | |
OLD | NEW |