Remove RecentTabsUIAdapter and RecentTabSuggestionProvider
RecentTabsUIAdapter and RecentTabSuggestionProvider are deprecated, so
removing them as well as the flag used for it.
The furthest the feature got was Canary/Dev M57 and then got cancelled.
Previous launch bug: https://crbug.com/659205
Bug: 659205
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I5403d6e5f642531b15a548499aae7b063d9406e1
Reviewed-on: https://chromium-review.googlesource.com/1040907
Reviewed-by: Theresa <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Filip Gorski <[email protected]>
Reviewed-by: vitaliii <[email protected]>
Commit-Queue: Yafei Duan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#556283}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
index ae134398..355c3265 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
@@ -112,8 +112,6 @@
public Boolean isContextMenuItemSupported(@ContextMenuItemId int menuItemId) {
if (menuItemId == ContextMenuManager.ID_REMOVE) return null;
- if (mCategory == KnownCategories.RECENT_TABS) return false;
-
if (mCategory == KnownCategories.DOWNLOADS) {
if (menuItemId == ContextMenuManager.ID_OPEN_IN_INCOGNITO_TAB) return false;
if (menuItemId == ContextMenuManager.ID_SAVE_FOR_OFFLINE) return false;
@@ -137,7 +135,7 @@
navigationDelegate.navigateToRecentTabs();
break;
case KnownCategories.PHYSICAL_WEB_PAGES_DEPRECATED:
- case KnownCategories.RECENT_TABS:
+ case KnownCategories.RECENT_TABS_DEPRECATED:
case KnownCategories.ARTICLES:
default:
Log.wtf(TAG, "'Empty State' action called for unsupported category: %d", mCategory);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
index 61f4be50..65bc4601 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
@@ -242,30 +242,7 @@
@Override
public boolean requiresExactOfflinePage() {
- return isDownload() || isRecentTab();
- }
-
- public boolean isRecentTab() {
- return mCategory == KnownCategories.RECENT_TABS;
- }
-
- /**
- * @return the corresponding recent tab id. May only be called if this snippet is a recent tab
- * article.
- */
- public int getRecentTabId() {
- assert isRecentTab();
- return mRecentTabId;
- }
-
- /**
- * Sets tab id and offline page id for recent tab articles. May only be called if this snippet
- * is a recent tab article.
- */
- public void setRecentTabData(int tabId, long offlinePageId) {
- assert isRecentTab();
- mRecentTabId = tabId;
- setOfflinePageOfflineId(offlinePageId);
+ return isDownload();
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
index 6594ff7..97d3923 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
@@ -219,12 +219,6 @@
}
@CalledByNative
- private static void setRecentTabDataForSuggestion(
- SnippetArticle suggestion, int tabId, long offlinePageId) {
- suggestion.setRecentTabData(tabId, offlinePageId);
- }
-
- @CalledByNative
private static SuggestionsCategoryInfo createSuggestionsCategoryInfo(int category, String title,
@ContentSuggestionsCardLayout int cardLayout,
@ContentSuggestionsAdditionalAction int additionalAction, boolean showIfEmpty,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
index 505c95c..ad6c9fc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
@@ -612,21 +612,11 @@
return nativeIsShowingDownloadButtonInErrorPage(mNativeOfflinePageBridge, webContents);
}
- /** Tells the native side that a new tab has been added for this profile. */
- void registerRecentTab(int tabId) {
- nativeRegisterRecentTab(mNativeOfflinePageBridge, tabId);
- }
-
/** Tells the native side that the tab of |webContents| will be closed. */
void willCloseTab(WebContents webContents) {
nativeWillCloseTab(mNativeOfflinePageBridge, webContents);
}
- /** Tells the native side that a new tab has been removed for this profile. */
- void unregisterRecentTab(int tabId) {
- nativeUnregisterRecentTab(mNativeOfflinePageBridge, tabId);
- }
-
/**
* Schedules to download a page from |url| and categorize under |nameSpace|.
* The duplicate pages or requests will be checked.
@@ -829,9 +819,7 @@
@VisibleForTesting
native void nativeGetAllPages(long nativeOfflinePageBridge, List<OfflinePageItem> offlinePages,
final Callback<List<OfflinePageItem>> callback);
- private native void nativeRegisterRecentTab(long nativeOfflinePageBridge, int tabId);
private native void nativeWillCloseTab(long nativeOfflinePageBridge, WebContents webContents);
- private native void nativeUnregisterRecentTab(long nativeOfflinePageBridge, int tabId);
@VisibleForTesting
native void nativeGetRequestsInQueue(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
index 3ab6f42..3d45e94 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
@@ -689,11 +689,6 @@
@Override
public void didAddTab(Tab tab, TabModel.TabLaunchType type) {
tab.addObserver(sTabRestoreTracker);
-
- Profile profile = mTabModelSelector.getModel(tab.isIncognito()).getProfile();
- OfflinePageBridge bridge = OfflinePageBridge.getForProfile(profile);
- if (bridge == null) return;
- bridge.registerRecentTab(tab.getId());
}
@Override
@@ -712,10 +707,7 @@
OfflinePageBridge bridge = OfflinePageBridge.getForProfile(profile);
if (bridge == null) return;
- // First, unregister the tab with the UI.
- bridge.unregisterRecentTab(tabId);
-
- // Then, delete any "Last N" offline pages as well. This is an optimization because
+ // Delete any "Last N" offline pages as well. This is an optimization because
// the UI will no longer show the page, and the page would also be cleaned up by GC
// given enough time.
ClientId clientId =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsEventReporterBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsEventReporterBridge.java
index 9b167d8..7cf2731 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsEventReporterBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsEventReporterBridge.java
@@ -61,9 +61,8 @@
case KnownCategories.BOOKMARKS:
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_BOOKMARKS_MANAGER);
break;
- // MORE button in both categories leads to the recent tabs manager
+ // MORE button leads to the recent tabs manager
case KnownCategories.FOREIGN_TABS:
- case KnownCategories.RECENT_TABS:
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_RECENT_TABS_MANAGER);
break;
case KnownCategories.DOWNLOADS:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java
index 1f61d29f..1215d57 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java
@@ -27,10 +27,8 @@
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
-import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
-import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.tabmodel.document.TabDelegate;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.common.Referrer;
@@ -119,13 +117,6 @@
return;
}
- if (article.isRecentTab()) {
- assert windowOpenDisposition == WindowOpenDisposition.CURRENT_TAB;
- boolean success = openRecentTabSnippet(article);
- assert success;
- return;
- }
-
// We explicitly open an offline page only for offline page downloads or for prefetched
// offline pages when Data Reduction Proxy is enabled. For all other
// sections the URL is opened and it is up to Offline Pages whether to open its offline
@@ -204,15 +195,6 @@
return loadingTab;
}
- private boolean openRecentTabSnippet(SnippetArticle article) {
- TabModel tabModel = mTabModelSelector.getModel(false);
- int tabId = article.getRecentTabId();
- int tabIndex = TabModelUtils.getTabIndexById(tabModel, tabId);
- if (tabIndex == TabModel.INVALID_TAB_INDEX) return false;
- TabModelUtils.setIndex(tabModel, tabIndex);
- return true;
- }
-
private void openUrlInNewWindow(LoadUrlParams loadUrlParams) {
TabDelegate tabDelegate = new TabDelegate(false);
tabDelegate.createTabInOtherWindow(loadUrlParams, mActivity, mHost.getParentId());
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfoTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfoTest.java
index 3b25ea2..d30deb23 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfoTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfoTest.java
@@ -42,24 +42,6 @@
}
@Test
- public void testRecentTabContextMenu() {
- SuggestionsCategoryInfo categoryInfo =
- new CategoryInfoBuilder(KnownCategories.RECENT_TABS).build();
- assertThat(
- categoryInfo.isContextMenuItemSupported(ContextMenuManager.ID_OPEN_IN_NEW_WINDOW),
- is(false));
- assertThat(categoryInfo.isContextMenuItemSupported(ContextMenuManager.ID_OPEN_IN_NEW_TAB),
- is(false));
- assertThat(categoryInfo.isContextMenuItemSupported(
- ContextMenuManager.ID_OPEN_IN_INCOGNITO_TAB),
- is(false));
- assertThat(categoryInfo.isContextMenuItemSupported(ContextMenuManager.ID_SAVE_FOR_OFFLINE),
- is(false));
- assertThat(
- categoryInfo.isContextMenuItemSupported(ContextMenuManager.ID_REMOVE), nullValue());
- }
-
- @Test
public void testArticleContextMenu() {
SuggestionsCategoryInfo categoryInfo =
new CategoryInfoBuilder(KnownCategories.ARTICLES).build();
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index ba8fc60d..fbc16e9 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -3793,7 +3793,6 @@
"//components/offline_pages/core/background:background_offliner",
"//components/offline_pages/core/downloads:offline_pages_ui_adapter",
"//components/offline_pages/core/prefetch",
- "//components/offline_pages/core/recent_tabs",
"//components/offline_pages/core/renovations",
"//components/offline_pages/core/request_header:request_header",
]
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index 6d583d4c..b2921e1 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -92,14 +92,6 @@
suggestion.download_suggestion_extra()->offline_page_id);
}
}
- if (suggestion.id().category().IsKnownCategory(
- KnownCategories::RECENT_TABS) &&
- suggestion.recent_tab_suggestion_extra() != nullptr) {
- Java_SnippetsBridge_setRecentTabDataForSuggestion(
- env, java_suggestion,
- suggestion.recent_tab_suggestion_extra()->tab_id,
- suggestion.recent_tab_suggestion_extra()->offline_page_id);
- }
}
return result;
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
index 8d2293c..65787da2 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -81,14 +81,12 @@
#include "chrome/browser/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h"
#include "chrome/browser/offline_pages/request_coordinator_factory.h"
-#include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h"
#include "components/ntp_snippets/remote/prefetched_pages_tracker_impl.h"
#include "components/offline_pages/core/background/request_coordinator.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/offline_page_model.h"
#include "components/offline_pages/core/prefetch/prefetch_service.h"
#include "components/offline_pages/core/prefetch/suggested_articles_observer.h"
-#include "components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.h"
#endif
using bookmarks::BookmarkModel;
@@ -107,7 +105,6 @@
using ntp_snippets::IsBookmarkProviderEnabled;
using ntp_snippets::IsDownloadsProviderEnabled;
using ntp_snippets::IsForeignSessionsProviderEnabled;
-using ntp_snippets::IsRecentTabProviderEnabled;
using ntp_snippets::PersistentScheduler;
using ntp_snippets::PrefetchedPagesTracker;
using ntp_snippets::RemoteSuggestionsDatabase;
@@ -131,7 +128,6 @@
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
using ntp_snippets::PrefetchedPagesTrackerImpl;
-using ntp_snippets::RecentTabSuggestionsProvider;
using offline_pages::OfflinePageModel;
using offline_pages::OfflinePageModelFactory;
using offline_pages::RequestCoordinator;
@@ -154,23 +150,6 @@
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
-void RegisterRecentTabProviderIfEnabled(ContentSuggestionsService* service,
- Profile* profile,
- OfflinePageModel* offline_page_model) {
- if (!IsRecentTabProviderEnabled()) {
- return;
- }
-
- RequestCoordinator* request_coordinator =
- RequestCoordinatorFactory::GetForBrowserContext(profile);
- offline_pages::DownloadUIAdapter* ui_adapter = offline_pages::
- RecentTabsUIAdapterDelegate::GetOrCreateRecentTabsUIAdapter(
- offline_page_model, request_coordinator);
- auto provider = std::make_unique<RecentTabSuggestionsProvider>(
- service, ui_adapter, profile->GetPrefs());
- service->RegisterProvider(std::move(provider));
-}
-
void RegisterWithPrefetching(ContentSuggestionsService* service,
Profile* profile) {
// There's a circular dependency between ContentSuggestionsService and
@@ -497,7 +476,6 @@
#endif // OS_ANDROID
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
- RegisterRecentTabProviderIfEnabled(service, profile, offline_page_model);
RegisterWithPrefetching(service, profile);
#endif
diff --git a/chrome/browser/ntp_snippets/dependent_features.cc b/chrome/browser/ntp_snippets/dependent_features.cc
index a0ca616..5ac907f 100644
--- a/chrome/browser/ntp_snippets/dependent_features.cc
+++ b/chrome/browser/ntp_snippets/dependent_features.cc
@@ -46,14 +46,6 @@
ntp_snippets::kBookmarkSuggestionsFeature);
}
-bool IsRecentTabProviderEnabled() {
- return !AreNtpShortcutsEnabled() &&
- base::FeatureList::IsEnabled(
- ntp_snippets::kRecentOfflineTabSuggestionsFeature) &&
- base::FeatureList::IsEnabled(
- offline_pages::kOffliningRecentPagesFeature);
-}
-
bool IsForeignSessionsProviderEnabled() {
return !AreNtpShortcutsEnabled() &&
base::FeatureList::IsEnabled(
diff --git a/chrome/browser/ntp_snippets/dependent_features.h b/chrome/browser/ntp_snippets/dependent_features.h
index 801621e5..38a8b22 100644
--- a/chrome/browser/ntp_snippets/dependent_features.h
+++ b/chrome/browser/ntp_snippets/dependent_features.h
@@ -17,8 +17,6 @@
bool IsBookmarkProviderEnabled();
-bool IsRecentTabProviderEnabled();
-
bool IsPhysicalWebPageProviderEnabled();
bool IsForeignSessionsProviderEnabled();
diff --git a/chrome/browser/offline_pages/android/offline_page_bridge.cc b/chrome/browser/offline_pages/android/offline_page_bridge.cc
index 8a5e2b5..fa9ce4f 100644
--- a/chrome/browser/offline_pages/android/offline_page_bridge.cc
+++ b/chrome/browser/offline_pages/android/offline_page_bridge.cc
@@ -42,7 +42,6 @@
#include "components/offline_pages/core/offline_page_item.h"
#include "components/offline_pages/core/offline_page_model.h"
#include "components/offline_pages/core/offline_page_types.h"
-#include "components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.h"
#include "components/offline_pages/core/request_header/offline_page_header.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
@@ -821,19 +820,6 @@
request_ids, base::Bind(&OnRemoveRequestsDone, j_callback_ref));
}
-void OfflinePageBridge::RegisterRecentTab(JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- int tab_id) {
- RequestCoordinator* request_coordinator =
- RequestCoordinatorFactory::GetForBrowserContext(browser_context_);
-
- RecentTabsUIAdapterDelegate* ui_adapter_delegate =
- RecentTabsUIAdapterDelegate::FromDownloadUIAdapter(
- RecentTabsUIAdapterDelegate::GetOrCreateRecentTabsUIAdapter(
- offline_page_model_, request_coordinator));
- ui_adapter_delegate->RegisterTab(tab_id);
-}
-
void OfflinePageBridge::WillCloseTab(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
@@ -850,19 +836,6 @@
tab_helper->WillCloseTab();
}
-void OfflinePageBridge::UnregisterRecentTab(JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- int tab_id) {
- RequestCoordinator* request_coordinator =
- RequestCoordinatorFactory::GetForBrowserContext(browser_context_);
-
- RecentTabsUIAdapterDelegate* ui_adapter_delegate =
- RecentTabsUIAdapterDelegate::FromDownloadUIAdapter(
- RecentTabsUIAdapterDelegate::GetOrCreateRecentTabsUIAdapter(
- offline_page_model_, request_coordinator));
- ui_adapter_delegate->UnregisterTab(tab_id);
-}
-
void OfflinePageBridge::ScheduleDownload(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
diff --git a/chrome/browser/offline_pages/android/offline_page_bridge.h b/chrome/browser/offline_pages/android/offline_page_bridge.h
index 9e49a6a9..489c65f 100644
--- a/chrome/browser/offline_pages/android/offline_page_bridge.h
+++ b/chrome/browser/offline_pages/android/offline_page_bridge.h
@@ -166,15 +166,9 @@
const base::android::JavaParamRef<jlongArray>& j_request_ids_array,
const base::android::JavaParamRef<jobject>& j_callback_obj);
- void RegisterRecentTab(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- int tab_id);
void WillCloseTab(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& j_web_contents);
- void UnregisterRecentTab(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- int tab_id);
void ScheduleDownload(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index b7ba0b7..c4aafae 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -182,7 +182,6 @@
#include "components/ntp_snippets/breaking_news/breaking_news_gcm_app_handler.h"
#include "components/ntp_snippets/breaking_news/subscription_manager_impl.h"
#include "components/ntp_snippets/category_rankers/click_based_category_ranker.h"
-#include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h"
#include "components/ntp_tiles/popular_sites_impl.h"
#else
#include "chrome/browser/gcm/gcm_product_util.h"
@@ -305,6 +304,9 @@
// Deprecated 4/2018.
const char kDismissedPhysicalWebPageSuggestions[] =
"ntp_suggestions.physical_web.dismissed_ids";
+// Deprecated 5/2018.
+const char kDismissedRecentOfflineTabSuggestions[] =
+ "ntp_suggestions.offline_pages.recent_tabs.dismissed_ids";
#else
// Deprecated 1/2018.
const char kShowFirstRunBubbleOption[] = "show-first-run-bubble-option";
@@ -330,6 +332,7 @@
#if defined(OS_ANDROID)
registry->RegisterListPref(kDismissedPhysicalWebPageSuggestions);
+ registry->RegisterListPref(kDismissedRecentOfflineTabSuggestions);
#endif
}
@@ -589,7 +592,6 @@
DownloadSuggestionsProvider::RegisterProfilePrefs(registry);
ntp_snippets::BreakingNewsGCMAppHandler::RegisterProfilePrefs(registry);
ntp_snippets::ClickBasedCategoryRanker::RegisterProfilePrefs(registry);
- ntp_snippets::RecentTabSuggestionsProvider::RegisterProfilePrefs(registry);
ntp_snippets::SubscriptionManagerImpl::RegisterProfilePrefs(registry);
OomInterventionDecider::RegisterProfilePrefs(registry);
#endif // defined(OS_ANDROID)
@@ -721,5 +723,8 @@
#if defined(OS_ANDROID)
// Added 4/2018
profile_prefs->ClearPref(kDismissedPhysicalWebPageSuggestions);
+
+ // Added 5/2018
+ profile_prefs->ClearPref(kDismissedRecentOfflineTabSuggestions);
#endif // defined(OS_ANDROID)
}
diff --git a/chrome/browser/resources/snippets_internals/snippets_internals.html b/chrome/browser/resources/snippets_internals/snippets_internals.html
index 318d0512..43869fec 100644
--- a/chrome/browser/resources/snippets_internals/snippets_internals.html
+++ b/chrome/browser/resources/snippets_internals/snippets_internals.html
@@ -26,9 +26,6 @@
<td class="name">Article Suggestions enabled
<td id="flag-article-suggestions" class="value">
<tr>
- <td class="name">Recent Tab Suggestions enabled
- <td id="flag-recent-offline-tab-suggestions" class="value">
- <tr>
<td class="name">Offlining Recent Tabs enabled
<td id="flag-offlining-recent-pages-feature" class="value">
<tr>
diff --git a/chrome/browser/ui/webui/snippets_internals/snippets_internals_message_handler.cc b/chrome/browser/ui/webui/snippets_internals/snippets_internals_message_handler.cc
index e1ebaeb..738860b 100644
--- a/chrome/browser/ui/webui/snippets_internals/snippets_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/snippets_internals/snippets_internals_message_handler.cc
@@ -54,7 +54,6 @@
using ntp_snippets::CategoryStatus;
using ntp_snippets::ContentSuggestion;
using ntp_snippets::IsBookmarkProviderEnabled;
-using ntp_snippets::IsRecentTabProviderEnabled;
using ntp_snippets::KnownCategories;
using ntp_snippets::RemoteSuggestion;
using ntp_snippets::RemoteSuggestionsProvider;
@@ -94,17 +93,6 @@
entry->Set("downloadSuggestionExtra", std::move(value));
}
- if (suggestion.recent_tab_suggestion_extra()) {
- const auto& extra = *suggestion.recent_tab_suggestion_extra();
- auto value = std::make_unique<base::DictionaryValue>();
- value->SetInteger("tabID", extra.tab_id);
- value->SetString(
- "offlinePageID",
- base::StringPrintf("0x%016llx", static_cast<long long unsigned int>(
- extra.offline_page_id)));
- entry->Set("recentTabSuggestionExtra", std::move(value));
- }
-
if (suggestion.notification_extra()) {
const auto& extra = *suggestion.notification_extra();
auto value = std::make_unique<base::DictionaryValue>();
@@ -425,8 +413,6 @@
"flag-article-suggestions",
base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature));
- SendBoolean("flag-recent-offline-tab-suggestions",
- IsRecentTabProviderEnabled());
SendBoolean("flag-offlining-recent-pages-feature",
base::FeatureList::IsEnabled(
offline_pages::kOffliningRecentPagesFeature));