| Index: extensions/browser/api/execute_code_function.h
|
| diff --git a/extensions/browser/api/execute_code_function.h b/extensions/browser/api/execute_code_function.h
|
| index db0f441c8149baa5391e216057478f1b77181a7b..118ec38c1dc6a0cef4e2bf18156a4290641f5e8d 100644
|
| --- a/extensions/browser/api/execute_code_function.h
|
| +++ b/extensions/browser/api/execute_code_function.h
|
| @@ -17,6 +17,11 @@ namespace extensions {
|
| // chrome.tabs.executeScript.
|
| class ExecuteCodeFunction : public AsyncExtensionFunction {
|
| public:
|
| + // Called when a file URL request is complete.
|
| + // Parameters:
|
| + // - whether the request is success.
|
| + // - If yes, the content of the file.
|
| + using WebUILoadFileCallback = base::Callback<void(bool, const std::string&)>;
|
| ExecuteCodeFunction();
|
|
|
| protected:
|
| @@ -33,6 +38,8 @@ class ExecuteCodeFunction : public AsyncExtensionFunction {
|
| virtual ScriptExecutor* GetScriptExecutor() = 0;
|
| virtual bool IsWebView() const = 0;
|
| virtual const GURL& GetWebViewSrc() const = 0;
|
| + virtual bool LoadFileForWebUI(const std::string& file_src,
|
| + const WebUILoadFileCallback& callback) = 0;
|
| virtual void OnExecuteCodeFinished(const std::string& error,
|
| const GURL& on_url,
|
| const base::ListValue& result);
|
| @@ -50,6 +57,9 @@ class ExecuteCodeFunction : public AsyncExtensionFunction {
|
| // arguments has been loaded.
|
| void DidLoadFile(bool success, const std::string& data);
|
|
|
| + // Called when the file is loaded for WebUI.
|
| + void DidLoadFileForWebUI(bool success, const std::string& data);
|
| +
|
| // Runs on FILE thread. Loads message bundles for the extension and
|
| // localizes the CSS data. Calls back DidLoadAndLocalizeFile on the UI thread.
|
| void GetFileURLAndLocalizeCSS(ScriptExecutor::ScriptType script_type,
|
|
|