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..6fec9ec26a93483e61e9c0392bdbbed86c87b8e5 100644 |
--- a/extensions/browser/api/execute_code_function.h |
+++ b/extensions/browser/api/execute_code_function.h |
@@ -17,6 +17,7 @@ namespace extensions { |
// chrome.tabs.executeScript. |
class ExecuteCodeFunction : public AsyncExtensionFunction { |
public: |
+ using WebUILoadFileCallback = base::Callback<void(bool, const std::string&)>; |
ExecuteCodeFunction(); |
protected: |
@@ -36,6 +37,8 @@ class ExecuteCodeFunction : public AsyncExtensionFunction { |
virtual void OnExecuteCodeFinished(const std::string& error, |
const GURL& on_url, |
const base::ListValue& result); |
+ virtual bool LoadFileForWebUI(const std::string& file_src, |
+ const WebUILoadFileCallback& callback) = 0; |
Fady Samuel
2015/03/14 04:26:56
Give this a default implementation here instead.
Xi Han
2015/03/16 14:36:05
Done.
|
// The injection details. |
scoped_ptr<core_api::extension_types::InjectDetails> details_; |
@@ -50,6 +53,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, |