Commit d7a20b36 authored by vitaliii's avatar vitaliii Committed by Commit bot

[NTP::RecentTabs] Enable by default and depend on recent tabs flag.

Make Recent Tabs (aka Open Tabs) provider depend on

Reason: M57 feature freeze is close and we want this provider in M57.
However, it is not clear whether recent tabs will be in M57, thus, we
enable our provider conditionally on them.

BUG=659205
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2609423002
Cr-Commit-Position: refs/heads/master@{#441384}
parent 01758e75
......@@ -61,6 +61,7 @@
#include "chrome/browser/ntp_snippets/download_suggestions_provider.h"
#include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h"
#include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/offline_page_model.h"
#include "components/physical_web/data_source/physical_web_data_source.h"
......@@ -101,6 +102,14 @@ void ClearScheduledTasks() {
}
#if defined(OS_ANDROID)
bool IsRecentTabProviderEnabled() {
return base::FeatureList::IsEnabled(
ntp_snippets::kRecentOfflineTabSuggestionsFeature) &&
base::FeatureList::IsEnabled(
offline_pages::kOffliningRecentPagesFeature);
}
void RegisterRecentTabProvider(OfflinePageModel* offline_page_model,
ContentSuggestionsService* service,
PrefService* pref_service) {
......@@ -285,8 +294,7 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
LanguageModelFactory::GetInstance()->GetForBrowserContext(profile);
#if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(
ntp_snippets::kRecentOfflineTabSuggestionsFeature)) {
if (IsRecentTabProviderEnabled()) {
RegisterRecentTabProvider(offline_page_model, service, pref_service);
}
......
......@@ -29,6 +29,9 @@ found in the LICENSE file.
<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>
<td class="name">Asset Download Suggestions enabled
<td id="flag-asset-download-suggestions" class="value">
......
......@@ -31,6 +31,7 @@
#include "components/ntp_snippets/remote/ntp_snippets_fetcher.h"
#include "components/ntp_snippets/remote/remote_suggestions_provider.h"
#include "components/ntp_snippets/switches.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
......@@ -280,6 +281,9 @@ void SnippetsInternalsMessageHandler::SendAllContent() {
SendBoolean("flag-recent-offline-tab-suggestions",
base::FeatureList::IsEnabled(
ntp_snippets::kRecentOfflineTabSuggestionsFeature));
SendBoolean("flag-offlining-recent-pages-feature",
base::FeatureList::IsEnabled(
offline_pages::kOffliningRecentPagesFeature));
SendBoolean(
"flag-asset-download-suggestions",
base::FeatureList::IsEnabled(features::kAssetDownloadSuggestionsFeature));
......
......@@ -18,7 +18,7 @@ const base::Feature kBookmarkSuggestionsFeature{
"NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kRecentOfflineTabSuggestionsFeature{
"NTPOfflinePageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
"NTPOfflinePageSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSaveToOfflineFeature{
"NTPSaveToOffline", base::FEATURE_ENABLED_BY_DEFAULT};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment