| Index: content/browser/webui/web_ui_message_handler.cc
|
| diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc
|
| index 44f065d44ed6f90d94387cd2af0e9ffdbb029779..73f780f5ea8daab61a31f874a344120ca2af8edd 100644
|
| --- a/content/browser/webui/web_ui_message_handler.cc
|
| +++ b/content/browser/webui/web_ui_message_handler.cc
|
| @@ -11,6 +11,20 @@
|
|
|
| namespace content {
|
|
|
| +void WebUIMessageHandler::AllowJavascript() {
|
| + if (javascript_allowed_)
|
| + return;
|
| +
|
| + javascript_allowed_ = true;
|
| + CHECK(IsJavascriptAllowed());
|
| +
|
| + OnJavascriptAllowed();
|
| +}
|
| +
|
| +bool WebUIMessageHandler::IsJavascriptAllowed() const {
|
| + return javascript_allowed_ && web_ui() && web_ui()->CanCallJavascript();
|
| +}
|
| +
|
| bool WebUIMessageHandler::ExtractIntegerValue(const base::ListValue* value,
|
| int* out_int) {
|
| std::string string_value;
|
| @@ -45,4 +59,12 @@ base::string16 WebUIMessageHandler::ExtractStringValue(
|
| return base::string16();
|
| }
|
|
|
| +void WebUIMessageHandler::RenderViewReused() {
|
| + if (!javascript_allowed_)
|
| + return;
|
| +
|
| + javascript_allowed_ = false;
|
| + OnJavascriptDisallowed();
|
| +}
|
| +
|
| } // namespace content
|
|
|