1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.android_webview; 6 7 import org.chromium.base.JNINamespace; 8 9 /** 10 * Controller for Remote Web Debugging (Developer Tools). 11 */ 12 @JNINamespace("android_webview") 13 public class AwDevToolsServer { 14 15 private long mNativeDevToolsServer = 0; 16 AwDevToolsServer()17 public AwDevToolsServer() { 18 mNativeDevToolsServer = nativeInitRemoteDebugging(); 19 } 20 destroy()21 public void destroy() { 22 nativeDestroyRemoteDebugging(mNativeDevToolsServer); 23 mNativeDevToolsServer = 0; 24 } 25 setRemoteDebuggingEnabled(boolean enabled)26 public void setRemoteDebuggingEnabled(boolean enabled) { 27 nativeSetRemoteDebuggingEnabled(mNativeDevToolsServer, enabled); 28 } 29 nativeInitRemoteDebugging()30 private native long nativeInitRemoteDebugging(); nativeDestroyRemoteDebugging(long devToolsServer)31 private native void nativeDestroyRemoteDebugging(long devToolsServer); nativeSetRemoteDebuggingEnabled(long devToolsServer, boolean enabled)32 private native void nativeSetRemoteDebuggingEnabled(long devToolsServer, boolean enabled); 33 } 34