Chromium Code Reviews| Index: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java |
| diff --git a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..38de355e3093731b4fd500daab4f4850a21e82e5 |
| --- /dev/null |
| +++ b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java |
| @@ -0,0 +1,41 @@ |
| +// 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.components.dom_distiller.core; |
| + |
| +import org.chromium.base.CalledByNative; |
| +import org.chromium.base.JNINamespace; |
| +import org.chromium.base.ThreadUtils; |
| + |
| +/** |
| + * Wrapper for native dom_distiller::DomDistillerService. |
| + */ |
| +@JNINamespace("dom_distiller::android") |
| +public final class DomDistillerService { |
| + |
| + private final long mDomDistillerServiceAndroid; |
| + private final DistilledPagePrefs mDistilledPagePrefs; |
| + |
| + private DomDistillerService(long nativeDomDistillerAndroidServicePtr) { |
| + mDomDistillerServiceAndroid = |
|
nyquist
2014/07/09 23:49:04
Nit: Does this fit on one line (100 chars in Java)
sunangel
2014/07/10 14:31:53
Done.
|
| + nativeDomDistillerAndroidServicePtr; |
| + mDistilledPagePrefs = new DistilledPagePrefs( |
| + nativeGetDistilledPagePrefsPtr( |
| + mDomDistillerServiceAndroid)); |
|
nyquist
2014/07/09 23:49:04
move this line to the previous line?
sunangel
2014/07/10 14:31:53
Done.
|
| + } |
| + |
| + public DistilledPagePrefs getDistilledPagePrefs() { |
| + return mDistilledPagePrefs; |
| + } |
| + |
| + @CalledByNative |
| + private static DomDistillerService create( |
|
nyquist
2014/07/09 23:49:04
does this fit on one line?
sunangel
2014/07/10 14:31:53
No. On 2014/07/09 23:49:04, nyquist wrote:
nyquist
2014/07/10 15:59:58
Are you sure? It looks to be around 80 characters
sunangel
2014/07/10 20:19:55
Oh okay sorry did not know that. Fixed now.
On 20
|
| + long nativeDomDistillerServiceAndroid) { |
| + ThreadUtils.assertOnUiThread(); |
| + return new DomDistillerService(nativeDomDistillerServiceAndroid); |
| + } |
| + |
| + private static native long nativeGetDistilledPagePrefsPtr( |
| + long nativeDomDistillerServiceAndroid); |
| +} |