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

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: small fixes 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 | « no previous file | content/browser/webui/web_ui_impl.cc » ('j') | content/browser/webui/web_ui_impl.cc » ('J')
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..3b714d2aacf2b404edb4de40209db36b95f17786 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_;
+ // Used to allow WebUI to be notified of WebContents navigations.
Charlie Reis 2016/06/24 23:15:01 // Notifies this WebUI about notifications in the
tommycli 2016/06/24 23:55:36 Done.
+ 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 | « no previous file | content/browser/webui/web_ui_impl.cc » ('j') | content/browser/webui/web_ui_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698