| Index: extensions/browser/guest_view/web_view/web_view_guest.h
|
| diff --git a/extensions/browser/guest_view/web_view/web_view_guest.h b/extensions/browser/guest_view/web_view/web_view_guest.h
|
| index cb190d9230b27414932897b33d77a9821599d5b6..cbf29cdf9df3f73ed58eef3fffba762ead0a892c 100644
|
| --- a/extensions/browser/guest_view/web_view/web_view_guest.h
|
| +++ b/extensions/browser/guest_view/web_view/web_view_guest.h
|
| @@ -25,6 +25,7 @@ struct WebFindOptions;
|
|
|
| namespace extensions {
|
|
|
| +class DeclarativeUserScriptMaster;
|
| class WebViewInternalFindFunction;
|
|
|
| // A WebViewGuest provides the browser-side implementation of the <webview> API
|
| @@ -235,11 +236,30 @@ class WebViewGuest : public GuestView<WebViewGuest>,
|
| uint32 removal_mask,
|
| const base::Closure& callback);
|
|
|
| + // Adds content script to inject on the guest.
|
| + void AddContentScripts(const std::string& script_name,
|
| + const UserScript& script);
|
| +
|
| + // Removes content script by |script_name|.
|
| + void RemoveContentScripts(const std::string& script_name);
|
| +
|
| + // Removes all content scripts added by the guest.
|
| + void RemoveAllContentScripts();
|
| +
|
| + // Returns whether |host_id_| is nullptr.
|
| + bool IsHostIDEmpty();
|
| +
|
| ScriptExecutor* script_executor() { return script_executor_.get(); }
|
| + const HostID& host_id() { return *host_id_; }
|
| + void set_host_id(scoped_ptr<const HostID> host_id) {
|
| + host_id_ = host_id.Pass();
|
| + }
|
|
|
| private:
|
| friend class WebViewPermissionHelper;
|
|
|
| + using UserScriptMap = std::map<std::string, UserScript>;
|
| +
|
| explicit WebViewGuest(content::WebContents* owner_web_contents);
|
|
|
| ~WebViewGuest() override;
|
| @@ -372,6 +392,13 @@ class WebViewGuest : public GuestView<WebViewGuest>,
|
| // Determines if this guest accepts pinch-zoom gestures.
|
| bool allow_scaling_;
|
|
|
| + // The ID of the injection host of the guest.
|
| + scoped_ptr<const HostID> host_id_;
|
| +
|
| + DeclarativeUserScriptMaster* master_;
|
| +
|
| + UserScriptMap user_script_map_;
|
| +
|
| // This is used to ensure pending tasks will not fire after this object is
|
| // destroyed.
|
| base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_;
|
|
|