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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Line breaks, commenting Created 6 years, 6 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: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..19ea5a57f9dc99a74e63419330c0e6ebeb706eb0
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java
@@ -0,0 +1,36 @@
+// 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.chrome.browser.dom_distiller;
+
+import java.util.HashMap;
+
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.components.dom_distiller.core.DomDistillerService;
+
+/**
+ * Returns Java DomDistillerService.
robliao 2014/06/27 17:37:12 This comment should go with getDomDistillerService
sunangel 2014/06/27 18:00:08 Done.
+ */
+public class DomDistillerServiceFactory {
+
+ static HashMap<Profile, DomDistillerService> profiles_to_DDS =
+ new HashMap<Profile, DomDistillerService>();
+
+ public static DomDistillerService getDomDistillerServiceForProfile(
+ Profile profile) {
+ DomDistillerService mDDS;
+ if (profiles_to_DDS.get(profile) == null) {
+ mDDS = new DomDistillerService(
+ nativeGetDomDistillerServiceForProfile(profile));
+ profiles_to_DDS.put(profile, mDDS);
+ }
+ else {
+ mDDS = profiles_to_DDS.get(profile);
+ }
+ return mDDS;
+ }
+
+ private static native long nativeGetDomDistillerServiceForProfile(
+ Profile profile);
+}

Powered by Google App Engine
This is Rietveld 408576698