Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: extensions/browser/api/execute_code_function.h

Issue 1004253002: Enable <webview>.executeScript outside of Apps and Extensions [2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698