Commit 90bc0f2f authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[FilesApp] Make the Files app window frame white in files-ng

Make the Files app window frame white in files-ng. The frame color of
Video Player, Gallery, and Audio Player are not changed.

Minor: Fix var/let/const pre-submit nits. Add eslint var exception to
the var loader = {} ... line, since per the patchset #1 try jobs, the

  KeyboardOperations/FilesAppBrowserTest*/keyboardOpenNewWindow*

tests fail if const (or let) is used instead of var.

Bug: 1057918
Change-Id: Ic7beb58e34b9d152bff90de1c775d7dd16442a47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2084335Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Auto-Submit: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746600}
parent b47eb45b
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
/** /**
* @type {!Object} * @type {!Object}
*/ */
// eslint-disable-next-line no-var
var launcher = {}; var launcher = {};
/** /**
...@@ -82,7 +83,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { ...@@ -82,7 +83,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => {
if (type == LaunchType.FOCUS_SAME_OR_CREATE || if (type == LaunchType.FOCUS_SAME_OR_CREATE ||
type == LaunchType.FOCUS_ANY_OR_CREATE) { type == LaunchType.FOCUS_ANY_OR_CREATE) {
if (opt_appState) { if (opt_appState) {
for (var key in window.appWindows) { for (const key in window.appWindows) {
if (!key.match(FILES_ID_PATTERN)) { if (!key.match(FILES_ID_PATTERN)) {
continue; continue;
} }
...@@ -114,7 +115,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { ...@@ -114,7 +115,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => {
// Focus any window if none is focused. Try restored first. // Focus any window if none is focused. Try restored first.
if (type == LaunchType.FOCUS_ANY_OR_CREATE) { if (type == LaunchType.FOCUS_ANY_OR_CREATE) {
// If there is already a focused window, then finish. // If there is already a focused window, then finish.
for (var key in window.appWindows) { for (const key in window.appWindows) {
if (!key.match(FILES_ID_PATTERN)) { if (!key.match(FILES_ID_PATTERN)) {
continue; continue;
} }
...@@ -134,7 +135,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { ...@@ -134,7 +135,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => {
} }
} }
// Try to focus the first non-minimized window. // Try to focus the first non-minimized window.
for (var key in window.appWindows) { for (const key in window.appWindows) {
if (!key.match(FILES_ID_PATTERN)) { if (!key.match(FILES_ID_PATTERN)) {
continue; continue;
} }
...@@ -149,7 +150,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { ...@@ -149,7 +150,7 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => {
} }
} }
// Restore and focus any window. // Restore and focus any window.
for (var key in window.appWindows) { for (const key in window.appWindows) {
if (!key.match(FILES_ID_PATTERN)) { if (!key.match(FILES_ID_PATTERN)) {
continue; continue;
} }
...@@ -170,6 +171,11 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { ...@@ -170,6 +171,11 @@ launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => {
nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1); nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1);
const appId = FILES_ID_PREFIX + id; const appId = FILES_ID_PREFIX + id;
// Make the files-ng frame color white.
if (util.isFilesNg()) {
FILE_MANAGER_WINDOW_CREATE_OPTIONS.frame.color = '#ffffff';
}
const appWindow = new AppWindowWrapper( const appWindow = new AppWindowWrapper(
'main.html', appId, FILE_MANAGER_WINDOW_CREATE_OPTIONS); 'main.html', appId, FILE_MANAGER_WINDOW_CREATE_OPTIONS);
appWindow.launch(opt_appState || {}, false, () => { appWindow.launch(opt_appState || {}, false, () => {
......
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