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

Unified Diff: chromecast/base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java

Issue 1180633002: Chromecast: don't try to upload crash immediately. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 5 years, 6 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: chromecast/base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java b/chromecast/base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java
new file mode 100644
index 0000000000000000000000000000000000000000..ba714dbeac9e767270a68f87ad880ae1c782528c
--- /dev/null
+++ b/chromecast/base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java
@@ -0,0 +1,37 @@
+// Copyright 2015 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.chromecast.base;
+
+import android.content.Context;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+/**
+ * JNI wrapper class for calls from ChromecastConfigAndroid.
+ */
+@JNINamespace("chromecast::android")
+public final class ChromecastConfigAndroid {
+
+ private static CastSettingsManager sSettingsManager;
+
+ public static void initializeForBrowser(Context applicationContext) {
+ sSettingsManager = CastSettingsManager.createCastSettingsManager(
+ applicationContext,
+ new CastSettingsManager.OnSettingChangedListener() {
+ @Override
+ public void onSendUsageStatsChanged(boolean enabled) {
+ nativeSetSendUsageStatsEnabled(enabled);
+ }
+ });
+ }
+
+ @CalledByNative
+ public static boolean canSendUsageStats(Context context) {
+ return sSettingsManager.isSendUsageStatsEnabled();
+ }
+
+ private static native void nativeSetSendUsageStatsEnabled(boolean enabled);
+}

Powered by Google App Engine
This is Rietveld 408576698