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

Unified Diff: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting changes, added test Created 6 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
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);
+}

Powered by Google App Engine
This is Rietveld 408576698