Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / chromeos / dbus / metronome_client.h
blobcaa546ba7fb1339d045f5558643f04d90cf3252c
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.
5 #ifndef CHROMEOS_DBUS_METRONOME_CLIENT_H_
6 #define CHROMEOS_DBUS_METRONOME_CLIENT_H_
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "base/memory/ref_counted.h"
11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/dbus/dbus_client.h"
13 #include "chromeos/dbus/dbus_client_implementation_type.h"
15 namespace chromeos {
17 // A DBus client class for the org.chromium.Metronome service.
18 class CHROMEOS_EXPORT MetronomeClient : public DBusClient {
19 public:
20 // Interface for observing timestamp events from a metronome client.
21 class Observer {
22 public:
23 // Called when the TimestampUpdated signal is received.
24 virtual void OnTimestampUpdated(uint64 beacon_timestamp,
25 uint64 local_timestamp) = 0;
26 virtual ~Observer() {}
29 ~MetronomeClient() override;
31 // Adds and removes observers for timestamp events.
32 virtual void AddObserver(Observer* observer) = 0;
33 virtual void RemoveObserver(Observer* observer) = 0;
35 // Factory function, creates a new instance and returns ownership.
36 // For normal usage, access the singleton via DBusThreadManager::Get().
37 static MetronomeClient* Create(DBusClientImplementationType type);
39 protected:
40 // Create() should be used instead.
41 MetronomeClient();
43 private:
44 DISALLOW_COPY_AND_ASSIGN(MetronomeClient);
47 } // namespace chromeos
49 #endif // CHROMEOS_DBUS_METRONOME_CLIENT_H_