summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/local_ntp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/chrome/browser/resources/local_ntp
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/local_ntp')
-rw-r--r--chromium/chrome/browser/resources/local_ntp/externs.js1
-rw-r--r--chromium/chrome/browser/resources/local_ntp/icons.grdp28
-rw-r--r--chromium/chrome/browser/resources/local_ntp/local_ntp.js44
-rw-r--r--chromium/chrome/browser/resources/local_ntp/voice.js4
4 files changed, 36 insertions, 41 deletions
diff --git a/chromium/chrome/browser/resources/local_ntp/externs.js b/chromium/chrome/browser/resources/local_ntp/externs.js
index a23b3244f00..11ad0c32056 100644
--- a/chromium/chrome/browser/resources/local_ntp/externs.js
+++ b/chromium/chrome/browser/resources/local_ntp/externs.js
@@ -33,7 +33,6 @@ let MostVisitedData;
* realboxEnabled: boolean,
* realboxMatchOmniboxTheme: boolean,
* richerPicker: boolean,
- * suggestionTransparencyEnabled: boolean,
* translatedStrings: Object<string>}}
*/
let configData;
diff --git a/chromium/chrome/browser/resources/local_ntp/icons.grdp b/chromium/chrome/browser/resources/local_ntp/icons.grdp
index 23d21d00472..b009d3e158e 100644
--- a/chromium/chrome/browser/resources/local_ntp/icons.grdp
+++ b/chromium/chrome/browser/resources/local_ntp/icons.grdp
@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<include name="IDR_LOCAL_NTP_ICONS_BOOKMARK"
- file="resources/local_ntp/icons/bookmark.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/bookmark.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_CALCULATOR"
- file="resources/local_ntp/icons/calculator.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/calculator.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_CLOCK"
- file="resources/local_ntp/icons/clock.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/clock.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_DOCS"
- file="resources/local_ntp/icons/drive_docs.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_docs.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_FOLDER"
- file="resources/local_ntp/icons/drive_folder.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_folder.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_FORM"
- file="resources/local_ntp/icons/drive_form.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_form.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_IMAGE"
- file="resources/local_ntp/icons/drive_image.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_image.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_LOGO"
- file="resources/local_ntp/icons/drive_logo.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_logo.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_PDF"
- file="resources/local_ntp/icons/drive_pdf.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_pdf.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_SHEETS"
- file="resources/local_ntp/icons/drive_sheets.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_sheets.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_SLIDES"
- file="resources/local_ntp/icons/drive_slides.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_slides.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_DRIVE_VIDEO"
- file="resources/local_ntp/icons/drive_video.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/drive_video.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_EXTENSION_APP"
- file="resources/local_ntp/icons/extension_app.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/extension_app.svg" type="BINDATA" />
<include name="IDR_LOCAL_NTP_ICONS_PAGE"
- file="resources/local_ntp/icons/page.svg" type="BINDATA" compress="gzip" />
+ file="resources/local_ntp/icons/page.svg" type="BINDATA" />
</grit-part>
diff --git a/chromium/chrome/browser/resources/local_ntp/local_ntp.js b/chromium/chrome/browser/resources/local_ntp/local_ntp.js
index 15950635804..d9d58e1ddef 100644
--- a/chromium/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chromium/chrome/browser/resources/local_ntp/local_ntp.js
@@ -1686,29 +1686,25 @@ function renderAutocompleteMatches(matches, suggestionGroupsMap) {
* @param {!function()} callback
*/
function createActionButton(callback) {
- const icon = document.createElement('button');
+ const icon = document.createElement('div');
icon.classList.add(CLASSES.REMOVE_ICON);
- icon.tabIndex = -1;
- icon.onmousedown = e => {
+ const action = document.createElement('button');
+ action.classList.add(CLASSES.REMOVE_MATCH);
+ action.appendChild(icon);
+ action.onmousedown = e => {
e.preventDefault(); // Stops default browser action (focus)
};
- icon.onauxclick = e => {
+ action.onauxclick = e => {
if (e.button == 1) {
// Middle click on delete should just noop for now (matches omnibox).
e.preventDefault();
}
};
- icon.onclick = e => {
+ action.onclick = e => {
callback();
e.preventDefault(); // Stops default browser action (navigation)
};
- const action = document.createElement('div');
-
- action.classList.add(CLASSES.REMOVE_MATCH);
- action.tabIndex = 0;
- action.setAttribute('role', 'button');
- action.appendChild(icon);
return action;
}
@@ -1747,18 +1743,18 @@ function renderAutocompleteMatches(matches, suggestionGroupsMap) {
// preventing the popup from losing focus and closing as a result.
headerEl.tabIndex = -1;
headerEl.append(document.createTextNode(suggestionGroup.header));
- if (configData.suggestionTransparencyEnabled) {
- const toggle = createActionButton(() => {
- groupEl.classList.toggle(CLASSES.COLLAPSED);
- updateToggleButtonA11y(
- toggle, groupEl.classList.contains(CLASSES.COLLAPSED));
- window.chrome.embeddedSearch.searchBox
- .toggleSuggestionGroupIdVisibility(suggestionGroupId);
- });
- updateToggleButtonA11y(toggle, suggestionGroup.hidden);
- headerEl.appendChild(toggle);
- realboxMatchesEl.classList.add(CLASSES.REMOVABLE);
- }
+
+ const toggle = createActionButton(() => {
+ groupEl.classList.toggle(CLASSES.COLLAPSED);
+ updateToggleButtonA11y(
+ toggle, groupEl.classList.contains(CLASSES.COLLAPSED));
+ window.chrome.embeddedSearch.searchBox.toggleSuggestionGroupIdVisibility(
+ suggestionGroupId);
+ });
+ updateToggleButtonA11y(toggle, suggestionGroup.hidden);
+ headerEl.appendChild(toggle);
+ realboxMatchesEl.classList.add(CLASSES.REMOVABLE);
+
groupEl.appendChild(headerEl);
realboxMatchesEl.appendChild(groupEl);
suggestionGroupElsMap[suggestionGroupId] = groupEl;
@@ -1852,7 +1848,7 @@ function renderAutocompleteMatches(matches, suggestionGroupsMap) {
}
}
- if (match.supportsDeletion && configData.suggestionTransparencyEnabled) {
+ if (match.supportsDeletion) {
const remove = createActionButton(() => {
window.chrome.embeddedSearch.searchBox.deleteAutocompleteMatch(i);
});
diff --git a/chromium/chrome/browser/resources/local_ntp/voice.js b/chromium/chrome/browser/resources/local_ntp/voice.js
index bb8ce4fa6b6..7d88c54feb2 100644
--- a/chromium/chrome/browser/resources/local_ntp/voice.js
+++ b/chromium/chrome/browser/resources/local_ntp/voice.js
@@ -31,7 +31,7 @@ function getChromeUILanguage() {
*/
const LOG_TYPE = {
// Activated by clicking on the fakebox icon.
- ACTION_ACTIVATE_FAKEBOX: 13,
+ ACTION_ACTIVATE_SEARCH_BOX: 13,
// Activated by keyboard shortcut.
ACTION_ACTIVATE_KEYBOARD: 14,
// Close the voice overlay by a user's explicit action.
@@ -308,7 +308,7 @@ speech.init = function(
fakeboxMicrophoneElem.onclick = function(event) {
// If propagated, closes the overlay (click on the background).
event.stopPropagation();
- speech.logEvent(LOG_TYPE.ACTION_ACTIVATE_FAKEBOX);
+ speech.logEvent(LOG_TYPE.ACTION_ACTIVATE_SEARCH_BOX);
speech.start();
};
fakeboxMicrophoneElem.onkeydown = function(event) {