Commit 6cc17790 authored by Austin Tankiang's avatar Austin Tankiang Committed by Commit Bot

Allow hosted files to be pinned behind flag

Bug: 1115028
Change-Id: I56e07ed021b97ab36a93ffb1e8724c2c49a7a2ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2355709Reviewed-by: default avatarSergei Datsenko <dats@chromium.org>
Commit-Queue: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798077}
parent c7d77f0c
...@@ -62,6 +62,10 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() { ...@@ -62,6 +62,10 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() {
dict->SetBoolean( dict->SetBoolean(
"FILTERS_IN_RECENTS_ENABLED", "FILTERS_IN_RECENTS_ENABLED",
base::FeatureList::IsEnabled(chromeos::features::kFiltersInRecents)); base::FeatureList::IsEnabled(chromeos::features::kFiltersInRecents));
dict->SetBoolean(
"DRIVE_BIDIRECTIONAL_NATIVE_MESSAGING_ENABLED",
base::FeatureList::IsEnabled(
chromeos::features::kDriveFsBidirectionalNativeMessaging));
dict->SetString("UI_LOCALE", extension_l10n_util::CurrentLocaleOrDefault()); dict->SetString("UI_LOCALE", extension_l10n_util::CurrentLocaleOrDefault());
......
...@@ -1443,6 +1443,15 @@ util.isTransferDetailsEnabled = () => { ...@@ -1443,6 +1443,15 @@ util.isTransferDetailsEnabled = () => {
return loadTimeData.getBoolean('FILES_TRANSFER_DETAILS_ENABLED'); return loadTimeData.getBoolean('FILES_TRANSFER_DETAILS_ENABLED');
}; };
/**
* Returns true if Drive bidirectional native messaging is enabled.
* @return {boolean}
*/
util.isDriveBidirectionalNativeMessagingEnabled = () => {
return loadTimeData.getBoolean(
'DRIVE_BIDIRECTIONAL_NATIVE_MESSAGING_ENABLED');
};
/** /**
* Retrieves all entries inside the given |rootEntry|. * Retrieves all entries inside the given |rootEntry|.
* @param {!DirectoryEntry} rootEntry * @param {!DirectoryEntry} rootEntry
......
...@@ -191,7 +191,8 @@ class DriveToggleOfflineAction { ...@@ -191,7 +191,8 @@ class DriveToggleOfflineAction {
entries, metadataModel, driveSyncHandler, ui, value, onExecute) { entries, metadataModel, driveSyncHandler, ui, value, onExecute) {
const actionableEntries = entries.filter(entry => { const actionableEntries = entries.filter(entry => {
const metadata = metadataModel.getCache([entry], ['hosted', 'pinned'])[0]; const metadata = metadataModel.getCache([entry], ['hosted', 'pinned'])[0];
if (metadata.hosted) { if (!util.isDriveBidirectionalNativeMessagingEnabled() &&
metadata.hosted) {
return false; return false;
} }
if (metadata.pinned === value) { if (metadata.pinned === value) {
......
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