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

Unified Diff: content/browser/time_zone_monitor.h

Issue 2304073003: Mojoify time zone update IPC from browser to renderer (Closed)
Patch Set: nits Created 4 years, 3 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: content/browser/time_zone_monitor.h
diff --git a/content/browser/time_zone_monitor.h b/content/browser/time_zone_monitor.h
index 95f70a39317cda74739e85d439a1c5a207f97192..8b0e71d1144c0d43f3bac1fac3a38819910c584c 100644
--- a/content/browser/time_zone_monitor.h
+++ b/content/browser/time_zone_monitor.h
@@ -8,6 +8,8 @@
#include <memory>
#include "base/macros.h"
+#include "device/time/public/interfaces/time_zone_monitor.mojom.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
namespace content {
@@ -28,22 +30,32 @@ namespace content {
// localtime in renderer processes with custom code that calls
// localtime in the browser process via Chrome IPC.
-class TimeZoneMonitor {
+// TODO(blundell): Update this class to be named TimeZoneMonitorImpl.
jam 2016/09/06 22:11:18 nit: btw no need to do that. the reason interfaces
blundell 2016/09/07 14:40:05 Ah convenient.
+class TimeZoneMonitor : public device::mojom::TimeZoneMonitor {
public:
// Returns a new TimeZoneMonitor object (likely a subclass) specific to the
// platform.
static std::unique_ptr<TimeZoneMonitor> Create();
- virtual ~TimeZoneMonitor();
+ ~TimeZoneMonitor() override;
+
+ void Bind(device::mojom::TimeZoneMonitorRequest request);
protected:
TimeZoneMonitor();
- // Loop over all renderers and notify them that the system time zone may
- // have changed.
- void NotifyRenderers();
+ // Notify all callbacks that the system time zone may have changed.
+ void NotifyClients();
private:
+ // device::mojom::device::mojom::TimeZoneMonitor:
+ void QueryNextTimeZoneChange(
+ const device::mojom::TimeZoneMonitor::QueryNextTimeZoneChangeCallback&
+ callback) override;
+
+ mojo::BindingSet<device::mojom::TimeZoneMonitor> bindings_;
+ std::vector<device::mojom::TimeZoneMonitor::QueryNextTimeZoneChangeCallback>
+ on_time_zone_change_tasks_;
DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitor);
};

Powered by Google App Engine
This is Rietveld 408576698