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

Unified Diff: chromeos/dbus/system_clock_client.h

Issue 12564007: Hook up system clock update dbus signal to chrome and ash tray ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix MockDBusThreadManagerWithoutGMock compiling issue. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/system_clock_client.h
diff --git a/chromeos/dbus/system_clock_client.h b/chromeos/dbus/system_clock_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..171cefd38dccbffea33626948a74761cc40708de
--- /dev/null
+++ b/chromeos/dbus/system_clock_client.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_
+#define CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_
+
+#include "base/observer_list.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+
+namespace dbus {
+class Bus;
+} // namespace
+
+namespace chromeos {
+
+// SystemClockClient is used to communicate with the system clock.
+class CHROMEOS_EXPORT SystemClockClient {
+ public:
+ // Interface for observing changes from the system clock.
+ class Observer {
+ public:
+ // Called when the status is updated.
+ 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.
+ };
+
+ virtual ~SystemClockClient();
+
+ // Adds and removes the observer.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+ // Returns true if this object has the given observer.
+ virtual bool HasObserver(Observer* observer) = 0;
+
+ // Creates the instance.
+ static SystemClockClient* Create(DBusClientImplementationType type,
+ dbus::Bus* bus);
+
+ protected:
+ // Create() should be used instead.
+ SystemClockClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemClockClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_SYSTEM_CLOCK_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698