Commit 56c9dc7c authored by kenobi's avatar kenobi Committed by Commit bot

Files.app: Disable the cloud import notification for active g+ photos app users.

If a user has auto-import enabled in the g+ photos app, don't enable cloud import, and don't pop up notifications for it yet.  We'll re-enable these notifications when the transition path has been smoothed a bit more.

BUG=462110

Review URL: https://codereview.chromium.org/955313002

Cr-Commit-Position: refs/heads/master@{#318237}
parent f5190e0b
...@@ -485,19 +485,12 @@ DeviceHandler.prototype.onMount_ = function(event) { ...@@ -485,19 +485,12 @@ DeviceHandler.prototype.onMount_ = function(event) {
* @this {DeviceHandler} * @this {DeviceHandler}
*/ */
function(appEnabled) { function(appEnabled) {
// We don't want to auto-open two windows // We don't want to auto-open two windows when a user
// when a user inserts a removable device. // inserts a removable device. Only open Files app if
// If Photos App is enabled only show a notification. // auto-import is disabled in Photos app.
if (appEnabled) { if (!appEnabled) {
if (metadata.deviceType && metadata.devicePath) {
DeviceHandler.Notification.DEVICE_IMPORT.show(
/** @type {string} */ (
metadata.devicePath));
}
} else {
this.openMediaDirectory_( this.openMediaDirectory_(
metadata.volumeId, metadata.volumeId, directory.fullPath);
directory.fullPath);
} }
}.bind(this)); }.bind(this));
}.bind(this)) }.bind(this))
......
...@@ -152,49 +152,6 @@ function testMtpMediaDeviceWithImportEnabled(callback) { ...@@ -152,49 +152,6 @@ function testMtpMediaDeviceWithImportEnabled(callback) {
reportPromise(resolver.promise, callback); reportPromise(resolver.promise, callback);
} }
function testMediaDeviceWithImportEnabledAndPhotosAppImportEnabled(callback) {
var storage = new MockChromeStorageAPI();
chrome.commandLinePrivate.cloudImportDisabled = false;
setupFileSystem(
VolumeManagerCommon.VolumeType.REMOVABLE,
'blabbity',
[
'/DCIM/',
'/DCIM/grandma.jpg'
]);
var promise = importer.handlePhotosAppMessage(true)
.then(
function() {
chrome.fileManagerPrivate.onMountCompleted.dispatch({
eventType: 'mount',
status: 'success',
volumeMetadata: {
volumeId: 'blabbity',
isParentDevice: true,
deviceType: 'usb',
devicePath: '/device/path',
deviceLabel: 'label',
hasMedia: true
},
shouldNotify: true
});
return chrome.notifications.resolver.promise.then(
function(notifications) {
assertEquals(1, Object.keys(notifications).length);
assertEquals(
'DEVICE_IMPORT',
notifications[
'deviceImport:/device/path'].message,
'Device notification did not have the right message.');
});
});
reportPromise(promise, callback);
}
function testMediaDeviceWithImportDisabled(callback) { function testMediaDeviceWithImportDisabled(callback) {
chrome.commandLinePrivate.cloudImportDisabled = true; chrome.commandLinePrivate.cloudImportDisabled = true;
......
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