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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/historyreport/AppIndexingReporter.java

Issue 2622313002: Add app indexing reporter public class. (Closed)
Patch Set: Add app indexing reporter public class. Created 3 years, 10 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/historyreport/AppIndexingReporter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/historyreport/AppIndexingReporter.java b/chrome/android/java/src/org/chromium/chrome/browser/historyreport/AppIndexingReporter.java
new file mode 100644
index 0000000000000000000000000000000000000000..d6add855b6e604772fbea6e51b0c28a3e756a800
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/historyreport/AppIndexingReporter.java
@@ -0,0 +1,31 @@
+// 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.historyreport;
+
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.ChromeApplication;
+
+/** Base class for reporting entities to App Indexing. */
+public class AppIndexingReporter {
+ private static final String TAG = "AppIndexingReporter";
+ private static AppIndexingReporter sInstance;
+
+ public static AppIndexingReporter getInstance() {
+ if (sInstance == null) {
+ sInstance = ((ChromeApplication) ContextUtils.getApplicationContext())
+ .createAppIndexingReporter();
+ }
+ return sInstance;
+ }
+
+ /**
+ * Reports provided entity to on-device index.
+ * Base class does not implement any reporting, and call is a no-op. Child classes should
+ * implement this functionality.
+ */
+ public void reportEntityJsonLd(String url, String json) {
+ // Overriden by private class. Base class does nothing.
+ }
+}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698