Commit a9542c42 authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Chromium LUCI CQ

[ntp] Add flag to disable shortcuts

Makes shortcuts Finch-configurable. Flag is enabled by default.

Bug: 1166872
Change-Id: I24c1b5cf6a0fe192f580b5dca899480730d000ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2633189
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844321}
parent 23b21199
......@@ -262,10 +262,12 @@
</ntp-realbox>
<dom-if if="[[lazyRender_]]" on-dom-change="onLazyRendered_">
<template>
<ntp-most-visited id="mostVisited" dark$="[[theme_.isDark]]"
use-white-add-icon$="[[theme_.shortcutUseWhiteAddIcon]]"
use-title-pill$="[[theme_.shortcutUseTitlePill]]">
</ntp-most-visited>
<template is="dom-if" if="[[shortcutsEnabled_]]">
<ntp-most-visited id="mostVisited" dark$="[[theme_.isDark]]"
use-white-add-icon$="[[theme_.shortcutUseWhiteAddIcon]]"
use-title-pill$="[[theme_.shortcutUseTitlePill]]">
</ntp-most-visited>
</template>
<ntp-middle-slot-promo
on-ntp-middle-slot-promo-loaded="onMiddleSlotPromoLoaded_">
</ntp-middle-slot-promo>
......
......@@ -197,6 +197,12 @@ class AppElement extends PolymerElement {
computed: 'computeRealboxShown_(theme_)',
},
/** @private */
shortcutsEnabled_: {
type: Boolean,
value: () => loadTimeData.getBoolean('shortcutsEnabled'),
},
/** @private */
modulesEnabled_: {
type: Boolean,
......
......@@ -214,7 +214,8 @@
<div id="backgroundsIcon" class="menu-item-icon"></div>
$i18n{backgroundsMenuItem}
</div>
<div class="menu-item" page-name="shortcuts" tabindex="0">
<div class="menu-item" page-name="shortcuts" tabindex="0"
hidden$="[[!shortcutsEnabled_]]">
<div id="shortcutsIcon" class="menu-item-icon"></div>
$i18n{shortcutsMenuItem}
</div>
......
......@@ -75,6 +75,12 @@ class CustomizeDialogElement extends PolymerElement {
backgroundSelection)`,
},
/** @private */
shortcutsEnabled_: {
type: Boolean,
value: () => loadTimeData.getBoolean('shortcutsEnabled'),
},
/** @private */
modulesEnabled_: {
type: Boolean,
......
......@@ -98,6 +98,8 @@ content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) {
source->AddBoolean(
"themeModeDoodlesEnabled",
base::FeatureList::IsEnabled(ntp_features::kWebUIThemeModeDoodles));
source->AddBoolean("shortcutsEnabled",
base::FeatureList::IsEnabled(ntp_features::kNtpShortcuts));
source->AddBoolean("modulesEnabled",
base::FeatureList::IsEnabled(ntp_features::kModules));
source->AddInteger("modulesLoadTimeout",
......
......@@ -75,6 +75,10 @@ const base::Feature kWebUI{"NtpWebUI", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebUIThemeModeDoodles{"WebUIThemeModeDoodles",
base::FEATURE_ENABLED_BY_DEFAULT};
// If enabled, shortcuts will be shown.
const base::Feature kNtpShortcuts{"NtpShortcuts",
base::FEATURE_ENABLED_BY_DEFAULT};
// If enabled, modules will be shown.
const base::Feature kModules{"NtpModules", base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -26,6 +26,7 @@ extern const base::Feature kRealboxMatchOmniboxTheme;
extern const base::Feature kRealboxUseGoogleGIcon;
extern const base::Feature kWebUI;
extern const base::Feature kWebUIThemeModeDoodles;
extern const base::Feature kNtpShortcuts;
extern const base::Feature kModules;
extern const base::Feature kNtpRecipeTasksModule;
extern const base::Feature kNtpShoppingTasksModule;
......
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