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

Unified Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.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: Antony's comments 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/guest_view/web_view/web_view_internal_api.h
diff --git a/extensions/browser/api/guest_view/web_view/web_view_internal_api.h b/extensions/browser/api/guest_view/web_view/web_view_internal_api.h
index 37483df9e0a1c09c9b74057999f9cb005b590faa..91b474e5bd790f3587d7e31d6c05a828dd576cff 100644
--- a/extensions/browser/api/guest_view/web_view/web_view_internal_api.h
+++ b/extensions/browser/api/guest_view/web_view/web_view_internal_api.h
@@ -66,8 +66,20 @@ class WebViewInternalExecuteCodeFunction
extensions::ScriptExecutor* GetScriptExecutor() final;
bool IsWebView() const override;
const GURL& GetWebViewSrc() const override;
+ bool LoadFile(const std::string& file) override;
private:
+ class WebUIURLFetcher;
+
+ // Loads a file url on WebUI.
+ bool LoadFileForWebUI(const std::string& file_src,
+ const WebUILoadFileCallback& callback);
+
+ // Called when the file is loaded for WebUI.
+ void DidLoadFileForWebUI(const std::string& file,
+ bool success,
+ const std::string& data);
+
// Contains extension resource built from path of file which is
// specified in JSON arguments.
extensions::ExtensionResource resource_;
@@ -76,6 +88,8 @@ class WebViewInternalExecuteCodeFunction
GURL guest_src_;
+ scoped_ptr<WebUIURLFetcher> url_fetcher_;
+
DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction);
};

Powered by Google App Engine
This is Rietveld 408576698