[DeviceService] Move //device/time_zone_monitor to //services/device

This CL:
  - moves //device/time_zone_monitor/ into //services/device/,
  - lets Device Service register all necessary JNIs on its creation,
  - consolidates all java files under //services/device/ into a single target:
    //services/device:java, and keeps this target still as part of
    //content/public/android:content_java, because Device Service is embeded
    by content_browser service currently.

BUG=689394, 687125
TEST=http://crbug.com/288697#c12: load the page, change the system time zone,
     and then click "recheck" to ensure that the renderer picks up the new
     time zone. Don't reload the page, which is likely to give you a new
     renderer process, use the "recheck" link on the page.
TBR=tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2690963002
Cr-Commit-Position: refs/heads/master@{#450619}
diff --git a/content/app/BUILD.gn b/content/app/BUILD.gn
index 21d91f9..2480465 100644
--- a/content/app/BUILD.gn
+++ b/content/app/BUILD.gn
@@ -55,7 +55,6 @@
       "//device/geolocation",
       "//device/power_save_blocker",
       "//device/sensors",
-      "//device/time_zone_monitor",
       "//device/usb",
       "//device/vibration",
       "//gpu",
diff --git a/content/app/DEPS b/content/app/DEPS
index d001ffa..76c9bee 100644
--- a/content/app/DEPS
+++ b/content/app/DEPS
@@ -8,7 +8,6 @@
   "+device/geolocation",
   "+device/power_save_blocker",
   "+device/sensors",
-  "+device/time_zone_monitor",
   "+device/usb",
   "+device/vibration",
   # For loading V8's initial snapshot from external files.
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc
index 77a7111..8d16801 100644
--- a/content/app/android/library_loader_hooks.cc
+++ b/content/app/android/library_loader_hooks.cc
@@ -31,7 +31,6 @@
 #include "device/generic_sensor/android/sensors_jni_registrar.h"
 #include "device/geolocation/android/geolocation_jni_registrar.h"
 #include "device/sensors/android/device_sensor_jni_registrar.h"
-#include "device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
 #include "device/usb/android/usb_jni_registrar.h"
 #include "media/base/android/media_jni_registrar.h"
 #include "media/capture/content/android/screen_capture_jni_registrar.h"
@@ -95,9 +94,6 @@
     if (!device::android::RegisterSensorsJni(env))
       return false;
 
-    if (!device::android::RegisterTimeZoneMonitorJni(env))
-      return false;
-
     if (!device::android::RegisterUsbJni(env))
       return false;
 
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
index d8a1896..508db32 100644
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@@ -44,7 +44,6 @@
     "//device/nfc/android:java",
     "//device/power_save_blocker:java",
     "//device/sensors:java",
-    "//device/time_zone_monitor:java",
     "//device/usb:java",
     "//device/vibration:mojo_bindings_java",
     "//device/vibration/android:vibration_manager_java",
@@ -56,6 +55,7 @@
     "//mojo/public/java:bindings_java",
     "//mojo/public/java:system_java",
     "//net/android:net_java",
+    "//services/device:java",
     "//services/service_manager/public/interfaces:interfaces_java",
     "//services/service_manager/public/java:service_manager_java",
     "//services/shape_detection/public/interfaces:interfaces_java",
diff --git a/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h b/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h
deleted file mode 100644
index 1581cd1..0000000
--- a/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 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 DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
-#define DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
-
-#include <jni.h>
-
-#include "device/time_zone_monitor/time_zone_monitor_export.h"
-
-namespace device {
-namespace android {
-
-bool DEVICE_TIME_ZONE_MONITOR_EXPORT RegisterTimeZoneMonitorJni(JNIEnv* env);
-
-}  // namespace android
-}  // namespace device
-
-#endif  // DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
diff --git a/device/time_zone_monitor/public/interfaces/BUILD.gn b/device/time_zone_monitor/public/interfaces/BUILD.gn
deleted file mode 100644
index 52ca0ce..0000000
--- a/device/time_zone_monitor/public/interfaces/BUILD.gn
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2016 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.
-
-import("//mojo/public/tools/bindings/mojom.gni")
-
-mojom("interfaces") {
-  sources = [
-    "time_zone_monitor.mojom",
-  ]
-}
diff --git a/device/time_zone_monitor/public/interfaces/OWNERS b/device/time_zone_monitor/public/interfaces/OWNERS
deleted file mode 100644
index 5e4aaef..0000000
--- a/device/time_zone_monitor/public/interfaces/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# Changes to Mojo interfaces require a security review to avoid
-# introducing new sandbox escapes.
-per-file *.mojom=set noparent
-per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/device/time_zone_monitor/time_zone_monitor_export.h b/device/time_zone_monitor/time_zone_monitor_export.h
deleted file mode 100644
index 7889326..0000000
--- a/device/time_zone_monitor/time_zone_monitor_export.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2016 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 DEVICE_TIME_ZONE_MONITOR_DEVICE_TIME_ZONE_MONITOR_EXPORT_H_
-#define DEVICE_TIME_ZONE_MONITOR_DEVICE_TIME_ZONE_MONITOR_EXPORT_H_
-
-#if defined(COMPONENT_BUILD)
-#if defined(WIN32)
-
-#if defined(DEVICE_TIME_ZONE_MONITOR_IMPLEMENTATION)
-#define DEVICE_TIME_ZONE_MONITOR_EXPORT __declspec(dllexport)
-#else
-#define DEVICE_TIME_ZONE_MONITOR_EXPORT __declspec(dllimport)
-#endif  // defined(DEVICE_TIME_ZONE_MONITOR_IMPLEMENTATION)
-
-#else  // defined(WIN32)
-#if defined(DEVICE_TIME_ZONE_MONITOR_IMPLEMENTATION)
-#define DEVICE_TIME_ZONE_MONITOR_EXPORT __attribute__((visibility("default")))
-#else
-#define DEVICE_TIME_ZONE_MONITOR_EXPORT
-#endif
-#endif
-
-#else  // defined(COMPONENT_BUILD)
-#define DEVICE_TIME_ZONE_MONITOR_EXPORT
-#endif
-
-#endif  // DEVICE_TIME_ZONE_MONITOR_DEVICE_TIME_ZONE_MONITOR_EXPORT_H_
diff --git a/services/device/BUILD.gn b/services/device/BUILD.gn
index 44681f24..1fbbf47 100644
--- a/services/device/BUILD.gn
+++ b/services/device/BUILD.gn
@@ -5,6 +5,10 @@
 import("//services/service_manager/public/cpp/service.gni")
 import("//services/service_manager/public/service_manifest.gni")
 
+if (is_android) {
+  import("//build/config/android/rules.gni")
+}
+
 source_set("lib") {
   sources = [
     "device_service.cc",
@@ -13,17 +17,17 @@
 
   deps = [
     "//base",
-    "//device/time_zone_monitor",
     "//services/device/power_monitor",
+    "//services/device/time_zone_monitor",
     "//services/service_manager/public/cpp",
   ]
 
-  public_deps = [
-    # TODO(blundell): This dep shouldn't be necessary at all,
-    # but content_shell fails to link in the component build if
-    # this isn't here as a public_dep.
-    "//device/time_zone_monitor/public/interfaces",
-  ]
+  if (is_android) {
+    sources += [
+      "//services/device/android/register_jni.cc",
+      "//services/device/android/register_jni.h",
+    ]
+  }
 }
 
 source_set("tests") {
@@ -48,3 +52,12 @@
   name = "device"
   source = "manifest.json"
 }
+
+if (is_android) {
+  android_library("java") {
+    java_files = [ "time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java" ]
+    deps = [
+      "//base:base_java",
+    ]
+  }
+}
diff --git a/services/device/android/register_jni.cc b/services/device/android/register_jni.cc
new file mode 100644
index 0000000..345a869
--- /dev/null
+++ b/services/device/android/register_jni.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2017 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.
+
+#include "services/device/android/register_jni.h"
+
+#include "base/android/jni_android.h"
+#include "services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
+
+namespace device {
+
+bool EnsureJniRegistered() {
+  static bool g_jni_init_done = false;
+
+  if (!g_jni_init_done) {
+    JNIEnv* env = base::android::AttachCurrentThread();
+
+    if (!android::RegisterTimeZoneMonitorJni(env))
+      return false;
+
+    g_jni_init_done = true;
+  }
+
+  return true;
+}
+
+}  // namespace device
diff --git a/services/device/android/register_jni.h b/services/device/android/register_jni.h
new file mode 100644
index 0000000..5874503
--- /dev/null
+++ b/services/device/android/register_jni.h
@@ -0,0 +1,16 @@
+// Copyright (c) 2017 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 SERVICES_DEVICE_ANDROID_REGISTER_JNI_H_
+#define SERVICES_DEVICE_ANDROID_REGISTER_JNI_H_
+
+namespace device {
+
+// Register all JNI bindings necessary for device service.
+// Is expected to be called on initialization of device service.
+bool EnsureJniRegistered();
+
+}  // namespace device
+
+#endif  // SERVICES_DEVICE_ANDROID_REGISTER_JNI_H_
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index 4cf7398..7a225c4 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -8,15 +8,26 @@
 #include "base/memory/ptr_util.h"
 #include "base/memory/weak_ptr.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "device/time_zone_monitor/time_zone_monitor.h"
 #include "services/device/power_monitor/power_monitor_message_broadcaster.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 #include "services/service_manager/public/cpp/connection.h"
 #include "services/service_manager/public/cpp/interface_registry.h"
 
+#if defined(OS_ANDROID)
+#include "services/device/android/register_jni.h"
+#endif
+
 namespace device {
 
 std::unique_ptr<service_manager::Service> CreateDeviceService(
     scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) {
+#if defined(OS_ANDROID)
+  if (!EnsureJniRegistered()) {
+    DLOG(ERROR) << "Failed to register JNI for Device Service";
+    return nullptr;
+  }
+#endif
+
   return base::MakeUnique<DeviceService>(std::move(file_task_runner));
 }
 
diff --git a/services/device/device_service.h b/services/device/device_service.h
index bb5fe94..a8ef507 100644
--- a/services/device/device_service.h
+++ b/services/device/device_service.h
@@ -6,9 +6,9 @@
 #define SERVICES_DEVICE_DEVICE_SERVICE_H_
 
 #include "base/memory/ref_counted.h"
-#include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h"
 #include "mojo/public/cpp/bindings/binding_set.h"
 #include "services/device/public/interfaces/power_monitor.mojom.h"
+#include "services/device/public/interfaces/time_zone_monitor.mojom.h"
 #include "services/service_manager/public/cpp/interface_factory.h"
 #include "services/service_manager/public/cpp/service.h"
 
diff --git a/services/device/public/interfaces/BUILD.gn b/services/device/public/interfaces/BUILD.gn
index f207c69..5ef17d7 100644
--- a/services/device/public/interfaces/BUILD.gn
+++ b/services/device/public/interfaces/BUILD.gn
@@ -7,6 +7,7 @@
 mojom("interfaces") {
   sources = [
     "power_monitor.mojom",
+    "time_zone_monitor.mojom",
   ]
 
   public_deps = [
diff --git a/device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom b/services/device/public/interfaces/time_zone_monitor.mojom
similarity index 100%
rename from device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom
rename to services/device/public/interfaces/time_zone_monitor.mojom
diff --git a/device/time_zone_monitor/BUILD.gn b/services/device/time_zone_monitor/BUILD.gn
similarity index 71%
rename from device/time_zone_monitor/BUILD.gn
rename to services/device/time_zone_monitor/BUILD.gn
index 9369844..ecef1fc 100644
--- a/device/time_zone_monitor/BUILD.gn
+++ b/services/device/time_zone_monitor/BUILD.gn
@@ -8,23 +8,20 @@
   import("//build/config/android/rules.gni")  # For generate_jni().
 }
 
-component("time_zone_monitor") {
+source_set("time_zone_monitor") {
+  visibility = [ "//services/device:lib" ]
+
   sources = [
-    "android/time_zone_monitor_jni_registrar.cc",
-    "android/time_zone_monitor_jni_registrar.h",
     "time_zone_monitor.cc",
     "time_zone_monitor.h",
     "time_zone_monitor_android.cc",
     "time_zone_monitor_android.h",
     "time_zone_monitor_chromeos.cc",
-    "time_zone_monitor_export.h",
     "time_zone_monitor_linux.cc",
     "time_zone_monitor_mac.mm",
     "time_zone_monitor_win.cc",
   ]
 
-  defines = [ "DEVICE_TIME_ZONE_MONITOR_IMPLEMENTATION" ]
-
   deps = [
     "//base",
     "//mojo/public/cpp/bindings",
@@ -32,10 +29,14 @@
   ]
 
   public_deps = [
-    "//device/time_zone_monitor/public/interfaces",
+    "//services/device/public/interfaces",
   ]
 
   if (is_android) {
+    sources += [
+      "android/time_zone_monitor_jni_registrar.cc",
+      "android/time_zone_monitor_jni_registrar.h",
+    ]
     deps += [ ":time_zone_monitor_jni_headers" ]
   }
 
@@ -54,16 +55,10 @@
 
 if (is_android) {
   generate_jni("time_zone_monitor_jni_headers") {
+    visibility = [ ":time_zone_monitor" ]
     sources = [
       "android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java",
     ]
     jni_package = "time_zone_monitor"
   }
-
-  android_library("java") {
-    java_files = [ "android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java" ]
-    deps = [
-      "//base:base_java",
-    ]
-  }
 }
diff --git a/device/time_zone_monitor/DEPS b/services/device/time_zone_monitor/DEPS
similarity index 100%
rename from device/time_zone_monitor/DEPS
rename to services/device/time_zone_monitor/DEPS
diff --git a/device/time_zone_monitor/OWNERS b/services/device/time_zone_monitor/OWNERS
similarity index 100%
rename from device/time_zone_monitor/OWNERS
rename to services/device/time_zone_monitor/OWNERS
diff --git a/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java b/services/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
similarity index 100%
rename from device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
rename to services/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
diff --git a/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc b/services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc
similarity index 80%
rename from device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc
rename to services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc
index 55ab5d5..6385d4f 100644
--- a/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc
+++ b/services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
+#include "services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_registrar.h"
-#include "device/time_zone_monitor/time_zone_monitor_android.h"
+#include "services/device/time_zone_monitor/time_zone_monitor_android.h"
 
 namespace device {
 namespace android {
diff --git a/services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h b/services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h
new file mode 100644
index 0000000..e6442ee
--- /dev/null
+++ b/services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h
@@ -0,0 +1,18 @@
+// Copyright 2016 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 SERVICES_DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
+#define SERVICES_DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
+
+#include <jni.h>
+
+namespace device {
+namespace android {
+
+bool RegisterTimeZoneMonitorJni(JNIEnv* env);
+
+}  // namespace android
+}  // namespace device
+
+#endif  // SERVICES_DEVICE_TIME_ZONE_MONITOR_ANDROID_TIME_ZONE_MONITOR_JNI_REGISTRAR_H_
diff --git a/device/time_zone_monitor/time_zone_monitor.cc b/services/device/time_zone_monitor/time_zone_monitor.cc
similarity index 96%
rename from device/time_zone_monitor/time_zone_monitor.cc
rename to services/device/time_zone_monitor/time_zone_monitor.cc
index 0e671b4..52e2a52 100644
--- a/device/time_zone_monitor/time_zone_monitor.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 #include "base/logging.h"
 #include "build/build_config.h"
diff --git a/device/time_zone_monitor/time_zone_monitor.h b/services/device/time_zone_monitor/time_zone_monitor.h
similarity index 81%
rename from device/time_zone_monitor/time_zone_monitor.h
rename to services/device/time_zone_monitor/time_zone_monitor.h
index f79f94a..730aa5d 100644
--- a/device/time_zone_monitor/time_zone_monitor.h
+++ b/services/device/time_zone_monitor/time_zone_monitor.h
@@ -2,17 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
-#define CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
+#ifndef SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_H_
+#define SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_H_
 
 #include <memory>
 
 #include "base/macros.h"
 #include "base/threading/thread_checker.h"
-#include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h"
-#include "device/time_zone_monitor/time_zone_monitor_export.h"
 #include "mojo/public/cpp/bindings/binding_set.h"
 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
+#include "services/device/public/interfaces/time_zone_monitor.mojom.h"
 
 template <class T>
 class scoped_refptr;
@@ -45,13 +44,12 @@
   // Returns a new TimeZoneMonitor object (likely a subclass) specific to the
   // platform. Inject |file_task_runner| to enable running blocking file
   // operations on it when necessary.
-  DEVICE_TIME_ZONE_MONITOR_EXPORT static std::unique_ptr<TimeZoneMonitor>
-  Create(scoped_refptr<base::SequencedTaskRunner> file_task_runner);
+  static std::unique_ptr<TimeZoneMonitor> Create(
+      scoped_refptr<base::SequencedTaskRunner> file_task_runner);
 
   ~TimeZoneMonitor() override;
 
-  DEVICE_TIME_ZONE_MONITOR_EXPORT void Bind(
-      device::mojom::TimeZoneMonitorRequest request);
+  void Bind(device::mojom::TimeZoneMonitorRequest request);
 
  protected:
   TimeZoneMonitor();
@@ -72,4 +70,4 @@
 
 }  // namespace device
 
-#endif  // CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
+#endif  // SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_H_
diff --git a/device/time_zone_monitor/time_zone_monitor_android.cc b/services/device/time_zone_monitor/time_zone_monitor_android.cc
similarity index 94%
rename from device/time_zone_monitor/time_zone_monitor_android.cc
rename to services/device/time_zone_monitor/time_zone_monitor_android.cc
index 0d1ea62..b15a90c 100644
--- a/device/time_zone_monitor/time_zone_monitor_android.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor_android.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/time_zone_monitor_android.h"
+#include "services/device/time_zone_monitor/time_zone_monitor_android.h"
 
 #include "base/android/context_utils.h"
 #include "base/android/jni_android.h"
diff --git a/device/time_zone_monitor/time_zone_monitor_android.h b/services/device/time_zone_monitor/time_zone_monitor_android.h
similarity index 75%
rename from device/time_zone_monitor/time_zone_monitor_android.h
rename to services/device/time_zone_monitor/time_zone_monitor_android.h
index 576b227..76cc17d 100644
--- a/device/time_zone_monitor/time_zone_monitor_android.h
+++ b/services/device/time_zone_monitor/time_zone_monitor_android.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_BROWSER_TIME_ZONE_MONITOR_ANDROID_H_
-#define CONTENT_BROWSER_TIME_ZONE_MONITOR_ANDROID_H_
+#ifndef SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_ANDROID_H_
+#define SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_ANDROID_H_
 
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 #include <jni.h>
 
@@ -36,4 +36,4 @@
 
 }  // namespace device
 
-#endif  // CONTENT_BROWSER_TIME_ZONE_MONITOR_ANDROID_H_
+#endif  // SERVICES_DEVICE_TIME_ZONE_MONITOR_TIME_ZONE_MONITOR_ANDROID_H_
diff --git a/device/time_zone_monitor/time_zone_monitor_chromeos.cc b/services/device/time_zone_monitor/time_zone_monitor_chromeos.cc
similarity index 94%
rename from device/time_zone_monitor/time_zone_monitor_chromeos.cc
rename to services/device/time_zone_monitor/time_zone_monitor_chromeos.cc
index 0c59b44..b1b7c010d 100644
--- a/device/time_zone_monitor/time_zone_monitor_chromeos.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor_chromeos.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 #include "base/macros.h"
 #include "chromeos/settings/timezone_settings.h"
diff --git a/device/time_zone_monitor/time_zone_monitor_linux.cc b/services/device/time_zone_monitor/time_zone_monitor_linux.cc
similarity index 97%
rename from device/time_zone_monitor/time_zone_monitor_linux.cc
rename to services/device/time_zone_monitor/time_zone_monitor_linux.cc
index 9aee0b2..22ab258 100644
--- a/device/time_zone_monitor/time_zone_monitor_linux.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor_linux.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 #include <stddef.h>
 #include <stdlib.h>
@@ -76,9 +76,7 @@
  private:
   friend class base::RefCountedThreadSafe<TimeZoneMonitorLinuxImpl>;
 
-  ~TimeZoneMonitorLinuxImpl() {
-    DCHECK(!owner_);
-  }
+  ~TimeZoneMonitorLinuxImpl() { DCHECK(!owner_); }
 
   void StartWatchingOnFileThread() {
     base::ThreadRestrictions::AssertIOAllowed();
diff --git a/device/time_zone_monitor/time_zone_monitor_mac.mm b/services/device/time_zone_monitor/time_zone_monitor_mac.mm
similarity index 94%
rename from device/time_zone_monitor/time_zone_monitor_mac.mm
rename to services/device/time_zone_monitor/time_zone_monitor_mac.mm
index 8cccb41..761bc1f 100644
--- a/device/time_zone_monitor/time_zone_monitor_mac.mm
+++ b/services/device/time_zone_monitor/time_zone_monitor_mac.mm
@@ -5,7 +5,7 @@
 #import <Foundation/Foundation.h>
 
 #include "base/macros.h"
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 namespace device {
 
diff --git a/device/time_zone_monitor/time_zone_monitor_win.cc b/services/device/time_zone_monitor/time_zone_monitor_win.cc
similarity index 94%
rename from device/time_zone_monitor/time_zone_monitor_win.cc
rename to services/device/time_zone_monitor/time_zone_monitor_win.cc
index d698911..b4a2695 100644
--- a/device/time_zone_monitor/time_zone_monitor_win.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor_win.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "device/time_zone_monitor/time_zone_monitor.h"
+#include "services/device/time_zone_monitor/time_zone_monitor.h"
 
 #include <windows.h>
 
diff --git a/third_party/WebKit/Source/modules/time_zone_monitor/BUILD.gn b/third_party/WebKit/Source/modules/time_zone_monitor/BUILD.gn
index efda79b..fcc3811 100644
--- a/third_party/WebKit/Source/modules/time_zone_monitor/BUILD.gn
+++ b/third_party/WebKit/Source/modules/time_zone_monitor/BUILD.gn
@@ -11,7 +11,6 @@
   ]
 
   deps = [
-    "//device/time_zone_monitor/public/interfaces:interfaces_blink",
     "//mojo/public/cpp/bindings",
     "//services/device/public/interfaces:interfaces_blink",
     "//services/service_manager/public/interfaces:interfaces_blink",
diff --git a/third_party/WebKit/Source/modules/time_zone_monitor/DEPS b/third_party/WebKit/Source/modules/time_zone_monitor/DEPS
index 212c63f..11c33b2f 100644
--- a/third_party/WebKit/Source/modules/time_zone_monitor/DEPS
+++ b/third_party/WebKit/Source/modules/time_zone_monitor/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
-    "+device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom-blink.h",
     "+mojo/public/cpp/bindings/binding.h",
     "+services/device/public/interfaces/constants.mojom-blink.h",
+    "+services/device/public/interfaces/time_zone_monitor.mojom-blink.h",
     "+third_party/icu/source/i18n/unicode/timezone.h",
 ]
diff --git a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.h b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.h
index 0dced07..5b60daa 100644
--- a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.h
+++ b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.h
@@ -5,8 +5,8 @@
 #ifndef TimeZoneMonitorClient_h
 #define TimeZoneMonitorClient_h
 
-#include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom-blink.h"
 #include "mojo/public/cpp/bindings/binding.h"
+#include "services/device/public/interfaces/time_zone_monitor.mojom-blink.h"
 
 namespace blink {