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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java

Issue 2729983002: Attaches OfflineContentAggregator to Profile (Closed)
Patch Set: Address nit Created 3 years, 9 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
« no previous file with comments | « chrome/android/java/DEPS ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..799da816a1fd0b6305a84cce37ce2b98a7d8ebb8
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java
@@ -0,0 +1,29 @@
+// Copyright 2017 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.download.items;
+
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.components.offline_items_collection.OfflineContentProvider;
+
+/**
+ * Basic factory that creates and returns an {@link OfflineContentProvider} that is attached
+ * natively to {@link Profile}.
+ */
+class OfflineContentAggregatorFactory {
+ private OfflineContentAggregatorFactory() {}
+
+ /**
+ * Used to get access to the {@link OfflineContentProvider} associated with {@code profile}.
+ * The same {@link OfflineContentProvider} will be returned for the same {@link Profile}.
+ * @param profile The {@link Profile} that owns the {@link OfflineContentProvider}.
+ * @return An {@link OfflineContentProvider} instance.
+ */
+ public static OfflineContentProvider forProfile(Profile profile) {
+ return nativeGetOfflineContentAggregatorForProfile(profile);
+ }
+
+ private static native OfflineContentProvider nativeGetOfflineContentAggregatorForProfile(
+ Profile profile);
+}
« no previous file with comments | « chrome/android/java/DEPS ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698