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

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

Issue 10540094: Add RemoteDebuggingController.java and its (native) dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 5 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/content_jni.gypi ('k') | content/public/browser/android/devtools_server.h » ('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/RemoteDebuggingController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/RemoteDebuggingController.java b/content/public/android/java/src/org/chromium/content/browser/RemoteDebuggingController.java
new file mode 100644
index 0000000000000000000000000000000000000000..cce0a58d50d00018ec73e45f8204f8aaf344b59d
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/RemoteDebuggingController.java
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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 org.chromium.base.JNINamespace;
+
+// Controls DevTools remote debugging server state.
+@JNINamespace("content")
+public class RemoteDebuggingController {
+
+ private static RemoteDebuggingController sInstance;
+
+ private boolean mUserPreferenceEnabled;
+
+ public static RemoteDebuggingController getInstance() {
+ if (sInstance == null) {
+ sInstance = new RemoteDebuggingController();
+ }
+ return sInstance;
+ }
+
+ public void updateUserPreferenceState(boolean enabled) {
+ if (mUserPreferenceEnabled != enabled) {
+ mUserPreferenceEnabled = enabled;
+ updateRemoteDebuggingState();
+ }
+ }
+
+ void updateRemoteDebuggingState() {
+ if (mUserPreferenceEnabled != nativeIsRemoteDebuggingEnabled()) {
+ if (mUserPreferenceEnabled) {
+ nativeStartRemoteDebugging();
+ } else {
+ nativeStopRemoteDebugging();
+ }
+ }
+ }
+
+ private RemoteDebuggingController() {
+ mUserPreferenceEnabled = nativeIsRemoteDebuggingEnabled();
+ }
+
+ private static native void nativeStartRemoteDebugging();
+ private static native void nativeStopRemoteDebugging();
+ private static native boolean nativeIsRemoteDebuggingEnabled();
+}
« no previous file with comments | « content/content_jni.gypi ('k') | content/public/browser/android/devtools_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698