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 @@ ...@@ -262,10 +262,12 @@
</ntp-realbox> </ntp-realbox>
<dom-if if="[[lazyRender_]]" on-dom-change="onLazyRendered_"> <dom-if if="[[lazyRender_]]" on-dom-change="onLazyRendered_">
<template> <template>
<ntp-most-visited id="mostVisited" dark$="[[theme_.isDark]]" <template is="dom-if" if="[[shortcutsEnabled_]]">
use-white-add-icon$="[[theme_.shortcutUseWhiteAddIcon]]" <ntp-most-visited id="mostVisited" dark$="[[theme_.isDark]]"
use-title-pill$="[[theme_.shortcutUseTitlePill]]"> use-white-add-icon$="[[theme_.shortcutUseWhiteAddIcon]]"
</ntp-most-visited> use-title-pill$="[[theme_.shortcutUseTitlePill]]">
</ntp-most-visited>
</template>
<ntp-middle-slot-promo <ntp-middle-slot-promo
on-ntp-middle-slot-promo-loaded="onMiddleSlotPromoLoaded_"> on-ntp-middle-slot-promo-loaded="onMiddleSlotPromoLoaded_">
</ntp-middle-slot-promo> </ntp-middle-slot-promo>
......
...@@ -197,6 +197,12 @@ class AppElement extends PolymerElement { ...@@ -197,6 +197,12 @@ class AppElement extends PolymerElement {
computed: 'computeRealboxShown_(theme_)', computed: 'computeRealboxShown_(theme_)',
}, },
/** @private */
shortcutsEnabled_: {
type: Boolean,
value: () => loadTimeData.getBoolean('shortcutsEnabled'),
},
/** @private */ /** @private */
modulesEnabled_: { modulesEnabled_: {
type: Boolean, type: Boolean,
......
...@@ -214,7 +214,8 @@ ...@@ -214,7 +214,8 @@
<div id="backgroundsIcon" class="menu-item-icon"></div> <div id="backgroundsIcon" class="menu-item-icon"></div>
$i18n{backgroundsMenuItem} $i18n{backgroundsMenuItem}
</div> </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> <div id="shortcutsIcon" class="menu-item-icon"></div>
$i18n{shortcutsMenuItem} $i18n{shortcutsMenuItem}
</div> </div>
......
...@@ -75,6 +75,12 @@ class CustomizeDialogElement extends PolymerElement { ...@@ -75,6 +75,12 @@ class CustomizeDialogElement extends PolymerElement {
backgroundSelection)`, backgroundSelection)`,
}, },
/** @private */
shortcutsEnabled_: {
type: Boolean,
value: () => loadTimeData.getBoolean('shortcutsEnabled'),
},
/** @private */ /** @private */
modulesEnabled_: { modulesEnabled_: {
type: Boolean, type: Boolean,
......
...@@ -98,6 +98,8 @@ content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) { ...@@ -98,6 +98,8 @@ content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) {
source->AddBoolean( source->AddBoolean(
"themeModeDoodlesEnabled", "themeModeDoodlesEnabled",
base::FeatureList::IsEnabled(ntp_features::kWebUIThemeModeDoodles)); base::FeatureList::IsEnabled(ntp_features::kWebUIThemeModeDoodles));
source->AddBoolean("shortcutsEnabled",
base::FeatureList::IsEnabled(ntp_features::kNtpShortcuts));
source->AddBoolean("modulesEnabled", source->AddBoolean("modulesEnabled",
base::FeatureList::IsEnabled(ntp_features::kModules)); base::FeatureList::IsEnabled(ntp_features::kModules));
source->AddInteger("modulesLoadTimeout", source->AddInteger("modulesLoadTimeout",
......
...@@ -75,6 +75,10 @@ const base::Feature kWebUI{"NtpWebUI", base::FEATURE_ENABLED_BY_DEFAULT}; ...@@ -75,6 +75,10 @@ const base::Feature kWebUI{"NtpWebUI", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebUIThemeModeDoodles{"WebUIThemeModeDoodles", const base::Feature kWebUIThemeModeDoodles{"WebUIThemeModeDoodles",
base::FEATURE_ENABLED_BY_DEFAULT}; 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. // If enabled, modules will be shown.
const base::Feature kModules{"NtpModules", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kModules{"NtpModules", base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -26,6 +26,7 @@ extern const base::Feature kRealboxMatchOmniboxTheme; ...@@ -26,6 +26,7 @@ extern const base::Feature kRealboxMatchOmniboxTheme;
extern const base::Feature kRealboxUseGoogleGIcon; extern const base::Feature kRealboxUseGoogleGIcon;
extern const base::Feature kWebUI; extern const base::Feature kWebUI;
extern const base::Feature kWebUIThemeModeDoodles; extern const base::Feature kWebUIThemeModeDoodles;
extern const base::Feature kNtpShortcuts;
extern const base::Feature kModules; extern const base::Feature kModules;
extern const base::Feature kNtpRecipeTasksModule; extern const base::Feature kNtpRecipeTasksModule;
extern const base::Feature kNtpShoppingTasksModule; 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