Chromium Code Reviews| 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); |
| }; |