Chromium Code Reviews| 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..1616e0e331b06cf605c1e711af9951f75b6e9699 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&)>; |
|
Devlin
2015/03/23 22:03:25
This doesn't belong here.
Xi Han
2015/03/24 15:11:48
Move to WebViewInternalExecuteCodeFunction.
|
| ExecuteCodeFunction(); |
| protected: |
| @@ -45,6 +50,13 @@ class ExecuteCodeFunction : public AsyncExtensionFunction { |
| host_id_ = host_id; |
| } |
| + protected: |
| + virtual bool LoadFile(const std::string& file); |
| + |
| + // Run in UI thread. Code string contains the code to be executed. Returns |
| + // true on success. If true is returned, this does an AddRef. |
| + bool Execute(const std::string& code_string); |
| + |
| private: |
| // Called when contents from the file whose path is specified in JSON |
| // arguments has been loaded. |
| @@ -61,10 +73,6 @@ class ExecuteCodeFunction : public AsyncExtensionFunction { |
| // Called when contents from the loaded file have been localized. |
| void DidLoadAndLocalizeFile(bool success, const std::string& data); |
| - // Run in UI thread. Code string contains the code to be executed. Returns |
| - // true on success. If true is returned, this does an AddRef. |
| - bool Execute(const std::string& code_string); |
| - |
| // Contains extension resource built from path of file which is |
| // specified in JSON arguments. |
| ExtensionResource resource_; |