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

Unified Diff: content/browser/time_zone_monitor.h

Issue 2304073003: Mojoify time zone update IPC from browser to renderer (Closed)
Patch Set: Rebase 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/time_zone_monitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bf001738c38c15c583ed51a56b092ea167c88ece 100644
--- a/content/browser/time_zone_monitor.h
+++ b/content/browser/time_zone_monitor.h
@@ -8,6 +8,9 @@
#include <memory>
#include "base/macros.h"
+#include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "mojo/public/cpp/bindings/interface_ptr_set.h"
namespace content {
@@ -28,22 +31,28 @@ namespace content {
// localtime in renderer processes with custom code that calls
// localtime in the browser process via Chrome IPC.
-class TimeZoneMonitor {
+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 AddClient(device::mojom::TimeZoneMonitorClientPtr client) override;
+
+ mojo::BindingSet<device::mojom::TimeZoneMonitor> bindings_;
+ mojo::InterfacePtrSet<device::mojom::TimeZoneMonitorClient> clients_;
DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitor);
};
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/time_zone_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698