Commit 9210338d authored by Tatsuhisa Yamaguchi's avatar Tatsuhisa Yamaguchi Committed by Commit Bot

Prevent popping up Files app window with Incognito context for ZIP.

While 1+ incognito browser windows are opened, it'll have separate Files
app extension background and foreground scripts running. The ones in
the incognito context should only be visible by the file picker window
invoked by the browser, but should not show fullscreen app windows or
notifications.

This fix prevents opening a new Files app. window in incognito context
in these cases:
- When mounting a new zip file as a volume
- When reopening a zip file already mounted
  (which navigates the current window to it)

Bug: 800543
Test: manually
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ib3deccef39a9db61e6ff4d035a6de19c7309d113
Reviewed-on: https://chromium-review.googlesource.com/888192Reviewed-by: default avatarDaichi Hirono <hirono@chromium.org>
Commit-Queue: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533217}
parent f5f71458
......@@ -146,8 +146,18 @@ FileBrowserBackgroundImpl.prototype.ready = function(callback) {
* devicePath.
* @private
*/
FileBrowserBackgroundImpl.prototype.handleViewEvent_ =
function(event) {
FileBrowserBackgroundImpl.prototype.handleViewEvent_ = function(event) {
util.doIfPrimaryContext(() => {
this.handleViewEventInternal_(event);
});
};
/**
* @param {!Event} event An event with the volumeId or
* devicePath.
* @private
*/
FileBrowserBackgroundImpl.prototype.handleViewEventInternal_ = function(event) {
volumeManagerFactory.getInstance()
.then(
(/**
......@@ -468,6 +478,17 @@ FileBrowserBackgroundImpl.prototype.findFocusedWindow_ = function() {
* @private
*/
FileBrowserBackgroundImpl.prototype.onMountCompleted_ = function(event) {
util.doIfPrimaryContext(() => {
this.onMountCompletedInternal_(event);
});
};
/**
* @param {!Object} event Event details.
* @private
*/
FileBrowserBackgroundImpl.prototype.onMountCompletedInternal_ = function(
event) {
// If there is no focused window, then create a new one opened on the
// mounted FSP volume.
this.findFocusedWindow_().then(function(key) {
......
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