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

Unified Diff: content/browser/webui/web_ui_impl.h

Issue 2099563002: WebUI: DisallowJavascript only on Refresh and non-same-page navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix style Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/webui/webui_browsertest.cc ('k') | content/browser/webui/web_ui_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_impl.h
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h
index 2f3c1eff89d68ad8ae4e3f6d90a89a50a1ecf207..752f839546982e0b2d80ea66a6b8d3248cc29ec4 100644
--- a/content/browser/webui/web_ui_impl.h
+++ b/content/browser/webui/web_ui_impl.h
@@ -83,6 +83,8 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
bool OnMessageReceived(const IPC::Message& message) override;
private:
+ class MainFrameNavigationObserver;
+
// IPC message handling.
void OnWebUISend(const GURL& source_url,
const std::string& message,
@@ -101,6 +103,9 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
void AddToSetIfFrameNameMatches(std::set<RenderFrameHost*>* frame_set,
RenderFrameHost* host);
+ // Called internally and by the owned MainFrameNavigationObserver.
+ void DisallowJavascriptOnAllHandlers();
+
// A map of message name -> message handling callback.
typedef std::map<std::string, MessageCallback> MessageCallbackMap;
MessageCallbackMap message_callbacks_;
@@ -118,6 +123,9 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
// Non-owning pointer to the WebContents this WebUI is associated with.
WebContents* web_contents_;
+ // Notifies this WebUI about notifications in the main frame.
+ std::unique_ptr<MainFrameNavigationObserver> web_contents_observer_;
+
// The name of the frame this WebUI is embedded in. If empty, the main frame
// is used.
const std::string frame_name_;
« no previous file with comments | « chrome/browser/ui/webui/webui_browsertest.cc ('k') | content/browser/webui/web_ui_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698