OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ |
6 #define CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
9 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
10 #include "chromeos/dbus/dbus_client.h" | 13 #include "chromeos/dbus/dbus_client.h" |
11 | 14 |
12 namespace chromeos { | 15 namespace chromeos { |
13 | 16 |
14 // SystemClockClient is used to communicate with the system clock. | 17 // SystemClockClient is used to communicate with the system clock. |
15 class CHROMEOS_EXPORT SystemClockClient : public DBusClient { | 18 class CHROMEOS_EXPORT SystemClockClient : public DBusClient { |
16 public: | 19 public: |
17 // Interface for observing changes from the system clock. | 20 // Interface for observing changes from the system clock. |
18 class Observer { | 21 class Observer { |
(...skipping 12 matching lines...) Expand all Loading... |
31 ~SystemClockClient() override; | 34 ~SystemClockClient() override; |
32 | 35 |
33 // Adds the given observer. | 36 // Adds the given observer. |
34 virtual void AddObserver(Observer* observer) = 0; | 37 virtual void AddObserver(Observer* observer) = 0; |
35 // Removes the given observer if this object has the observer. | 38 // Removes the given observer if this object has the observer. |
36 virtual void RemoveObserver(Observer* observer) = 0; | 39 virtual void RemoveObserver(Observer* observer) = 0; |
37 // Returns true if this object has the given observer. | 40 // Returns true if this object has the given observer. |
38 virtual bool HasObserver(const Observer* observer) const = 0; | 41 virtual bool HasObserver(const Observer* observer) const = 0; |
39 | 42 |
40 // Sets the system clock. | 43 // Sets the system clock. |
41 virtual void SetTime(int64 time_in_seconds) = 0; | 44 virtual void SetTime(int64_t time_in_seconds) = 0; |
42 | 45 |
43 // Checks if the system time can be set. | 46 // Checks if the system time can be set. |
44 virtual bool CanSetTime() = 0; | 47 virtual bool CanSetTime() = 0; |
45 | 48 |
46 // Creates the instance. | 49 // Creates the instance. |
47 static SystemClockClient* Create(); | 50 static SystemClockClient* Create(); |
48 | 51 |
49 protected: | 52 protected: |
50 // Create() should be used instead. | 53 // Create() should be used instead. |
51 SystemClockClient(); | 54 SystemClockClient(); |
52 | 55 |
53 private: | 56 private: |
54 DISALLOW_COPY_AND_ASSIGN(SystemClockClient); | 57 DISALLOW_COPY_AND_ASSIGN(SystemClockClient); |
55 }; | 58 }; |
56 | 59 |
57 } // namespace chromeos | 60 } // namespace chromeos |
58 | 61 |
59 #endif // CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | 62 #endif // CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ |
OLD | NEW |