OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 android.content.Context; |
| 8 import android.webkit.ValueCallback; |
| 9 |
| 10 import org.chromium.base.annotations.JNINamespace; |
| 11 |
| 12 /** |
| 13 * Java twin of the homonymous C++ class. The Java side is only responsible for |
| 14 * switching metrics on and off. Since the setting is a platform feature, it |
| 15 * must be obtained through PlatformServiceBridge. |
| 16 */ |
| 17 @JNINamespace("android_webview") |
| 18 public class AwMetricsServiceClient { |
| 19 public AwMetricsServiceClient(Context applicationContext) { |
| 20 PlatformServiceBridge.getInstance(applicationContext) |
| 21 .setMetricsSettingListener(new ValueCallback<Boolean>() { |
| 22 public void onReceiveValue(Boolean enabled) { |
| 23 nativeSetMetricsEnabled(enabled); |
| 24 } |
| 25 }); |
| 26 } |
| 27 |
| 28 public static native void nativeSetMetricsEnabled(boolean enabled); |
| 29 } |
OLD | NEW |