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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java

Issue 2623993007: 🏠 Extract the ContentSuggestionManager interface from NTP (Closed)
Patch Set: address comments Created 3 years, 11 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/suggestions/SuggestionsNavigationDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..beef47022e257cc9a8397bcb87bd93b72cba2bb3
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
@@ -0,0 +1,43 @@
+// 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.suggestions;
+
+import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
+import org.chromium.content_public.browser.LoadUrlParams;
+
+/**
+ * Interface exposing to the suggestion surface methods to navigate to other parts of the browser.
+ */
+public interface SuggestionsNavigationDelegate {
+ /** @return Whether context menus should allow the option to open a link in incognito. */
+ boolean isOpenInIncognitoEnabled();
+
+ /** @return Whether context menus should allow the option to open a link in a new window. */
+ boolean isOpenInNewWindowEnabled();
+
+ /** Opens the bookmarks page in the current tab. */
+ void navigateToBookmarks();
+
+ /** Opens the Download Manager UI in the current tab. */
+ void navigateToDownloadManager();
+
+ /** Opens the recent tabs page in the current tab. */
+ void navigateToRecentTabs();
+
+ /**
+ * Handles clicks on the "learn more" link in the footer.
+ */
+ void onLearnMoreClicked();
+
+ /**
+ * Opens a content suggestion and records related metrics.
+ * @param windowOpenDisposition How to open (current tab, new tab, new window etc).
+ * @param article The content suggestion to open.
+ */
+ void openSnippet(int windowOpenDisposition, SnippetArticle article);
+
+ /** Opens an url with the desired disposition. */
+ void openUrl(int windowOpenDisposition, LoadUrlParams loadUrlParams);
+}

Powered by Google App Engine
This is Rietveld 408576698