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..d19920a8b4a12f3749a74f782a4e0223e0e017ac |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java |
@@ -0,0 +1,35 @@ |
+// 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; |
+/** |
robliao
2014/06/26 18:42:15
Add one linebreak above here.
sunangel
2014/06/26 23:31:36
Done.
|
+ * Returns Java DomDistillerService. |
+ */ |
+public class DomDistillerServiceFactory { |
+ |
+ static HashMap<Profile, DomDistillerService> profiles_to_DDS = |
+ new HashMap<Profile, DomDistillerService>(); |
+ |
+ public static DomDistillerService getDomDistillerServiceForProfile(Profile |
robliao
2014/06/26 18:42:15
Break Profile type declaration on the next line.
sunangel
2014/06/26 23:31:36
Done.
|
+ profile) { |
+ DomDistillerService mDDS; |
+ if (profiles_to_DDS.get(profile) == null) { |
+ mDDS = new DomDistillerService( |
robliao
2014/06/26 18:42:15
This should be 4 spaces over along with all other
sunangel
2014/06/26 23:31:36
Done.
|
+ nativeGetDomDistillerServiceForProfile(profile)); |
robliao
2014/06/26 18:42:15
Statement continuation, needs 8 spaces.
sunangel
2014/06/26 23:31:35
Done.
|
+ profiles_to_DDS.put(profile, mDDS); |
+ } |
+ else { |
+ mDDS = profiles_to_DDS.get(profile); |
+ } |
+ return mDDS; |
+ } |
+ |
+ private static native long nativeGetDomDistillerServiceForProfile(Profile |
robliao
2014/06/26 18:42:15
Break Profile type declaration on the next line.
sunangel
2014/06/26 23:31:35
Done.
|
+ profile); |
+} |