Commit a54475be authored by hirono's avatar hirono Committed by Commit bot

Files.app: Add private API to check if PiexLoader is enabled or not.

PiexLoader is enabled only for official build.

BUG=396702
TEST=None
R=isherman@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#321933}
parent cbee8539
......@@ -460,4 +460,15 @@ void FileManagerPrivateGetMimeTypeFunction::OnGetMimeType(
SendResponse(true);
}
ExtensionFunction::ResponseAction
FileManagerPrivateIsPiexLoaderEnabledFunction::Run() {
#if defined(OFFICIAL_BUILD)
return RespondNow(OneArgument(
new base::FundamentalValue(true)));
#else
return RespondNow(OneArgument(
new base::FundamentalValue(false)));
#endif
}
} // namespace extensions
......@@ -181,6 +181,21 @@ class FileManagerPrivateGetMimeTypeFunction
void OnGetMimeType(const std::string& mimeType);
};
// Implements the chrome.fileManagerPrivate.isPiexLoaderEnabled method.
class FileManagerPrivateIsPiexLoaderEnabledFunction
: public UIThreadExtensionFunction {
public:
FileManagerPrivateIsPiexLoaderEnabledFunction() {}
DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.isPiexLoaderEnabled",
FILEMANAGERPRIVATE_ISPIEXLOADERENABLED)
protected:
~FileManagerPrivateIsPiexLoaderEnabledFunction() override {}
private:
ResponseAction Run() override;
DISALLOW_COPY_AND_ASSIGN(FileManagerPrivateIsPiexLoaderEnabledFunction);
};
} // namespace extensions
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_
......@@ -872,6 +872,9 @@ interface Functions {
DOMString key,
DOMString value,
SimpleCallback callback);
// Returns if Piex loader is enabled.
static void isPiexLoaderEnabled(BooleanCallback callback);
};
interface Events {
......
......@@ -1041,6 +1041,7 @@ enum HistogramValue {
FILEMANAGERPRIVATE_ENABLEEXTERNALFILESCHEME,
DEVELOPERPRIVATE_UPDATEEXTENSIONCONFIGURATION,
DEVELOPERPRIVATE_DELETEEXTENSIONERRORS,
FILEMANAGERPRIVATE_ISPIEXLOADERENABLED,
// Last entry: Add new entries above and ensure to update
// tools/metrics/histograms/histograms.xml.
ENUM_BOUNDARY
......
......@@ -574,6 +574,12 @@ chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
*/
chrome.fileManagerPrivate.setEntryTag = function(entryURL, visibility, key, value, callback) {};
/**
* Gets a flag indicating whether PiexLoader is enabled.
* @param {function(boolean)} callback
*/
chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};
/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onMountCompleted;
......
......@@ -49317,6 +49317,7 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="980" label="FILEMANAGERPRIVATE_ENABLEEXTERNALFILESCHEME"/>
<int value="981" label="DEVELOPERPRIVATE_UPDATEEXTENSIONCONFIGURATION"/>
<int value="982" label="DEVELOPERPRIVATE_DELETEEXTENSIONERRORS"/>
<int value="983" label="FILEMANAGERPRIVATE_ISPIEXLOADERENABLED"/>
</enum>
<enum name="ExtensionInstallCause" type="int">
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