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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java

Issue 2353283002: [TimeZoneMonitor] Decouple //content/browser/time_zone_monitor* to //device/. (Closed)
Patch Set: Do not set output_name in gn 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/public/android/BUILD.gn ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java b/content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java
deleted file mode 100644
index ff1726463136459304c51b32ac61fd505242a8a4..0000000000000000000000000000000000000000
--- a/content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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.
-
-package org.chromium.content.browser;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-
-import org.chromium.base.Log;
-import org.chromium.base.annotations.CalledByNative;
-import org.chromium.base.annotations.JNINamespace;
-
-/**
- * Android implementation details for content::TimeZoneMonitorAndroid.
- */
-@JNINamespace("content")
-class TimeZoneMonitor {
- private static final String TAG = "cr.TimeZoneMonitor";
-
- private final Context mAppContext;
- private final IntentFilter mFilter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
- private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (!intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED)) {
- Log.e(TAG, "unexpected intent");
- return;
- }
-
- nativeTimeZoneChangedFromJava(mNativePtr);
- }
- };
-
- private long mNativePtr;
-
- /**
- * Start listening for intents.
- * @param nativePtr The native content::TimeZoneMonitorAndroid to notify of time zone changes.
- */
- private TimeZoneMonitor(Context context, long nativePtr) {
- mAppContext = context.getApplicationContext();
- mNativePtr = nativePtr;
- mAppContext.registerReceiver(mBroadcastReceiver, mFilter);
- }
-
- @CalledByNative
- static TimeZoneMonitor getInstance(Context context, long nativePtr) {
- return new TimeZoneMonitor(context, nativePtr);
- }
-
- /**
- * Stop listening for intents.
- */
- @CalledByNative
- void stop() {
- mAppContext.unregisterReceiver(mBroadcastReceiver);
- mNativePtr = 0;
- }
-
- /**
- * Native JNI call to content::TimeZoneMonitorAndroid::TimeZoneChanged.
- * See content/browser/time_zone_monitor_android.cc.
- */
- private native void nativeTimeZoneChangedFromJava(long nativeTimeZoneMonitorAndroid);
-}
« no previous file with comments | « content/public/android/BUILD.gn ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698