Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | |
| 6 #define CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | |
| 7 | |
| 8 #include "base/observer_list.h" | |
| 9 #include "chromeos/chromeos_export.h" | |
| 10 #include "chromeos/dbus/dbus_client_implementation_type.h" | |
| 11 | |
| 12 namespace dbus { | |
| 13 class Bus; | |
| 14 } // namespace | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 // SystemClockClient is used to communicate with the system clock. | |
| 19 class CHROMEOS_EXPORT SystemClockClient { | |
| 20 public: | |
| 21 // Interface for observing changes from the system clock. | |
| 22 class Observer { | |
| 23 public: | |
| 24 // Called when the status is updated. | |
| 25 virtual void SystemClockUpdated() {} | |
|
stevenjb
2013/03/13 17:34:31
Add:
protected:
virtual void ~Observer {}
(I k
jennyz
2013/03/13 19:14:02
Done.
| |
| 26 }; | |
| 27 | |
| 28 virtual ~SystemClockClient(); | |
| 29 | |
| 30 // Adds and removes the observer. | |
| 31 virtual void AddObserver(Observer* observer) = 0; | |
| 32 virtual void RemoveObserver(Observer* observer) = 0; | |
| 33 // Returns true if this object has the given observer. | |
| 34 virtual bool HasObserver(Observer* observer) = 0; | |
| 35 | |
| 36 // Creates the instance. | |
| 37 static SystemClockClient* Create(DBusClientImplementationType type, | |
| 38 dbus::Bus* bus); | |
| 39 | |
| 40 protected: | |
| 41 // Create() should be used instead. | |
| 42 SystemClockClient(); | |
| 43 | |
| 44 private: | |
| 45 DISALLOW_COPY_AND_ASSIGN(SystemClockClient); | |
| 46 }; | |
| 47 | |
| 48 } // namespace chromeos | |
| 49 | |
| 50 #endif // CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_ | |
| OLD | NEW |