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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1271313003: Allow execution of JavaScript in Distiller pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/public/common/url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 // are received from the renderer to prevent abuse. 2200 // are received from the renderer to prevent abuse.
2201 if (request_params.page_state.IsValid()) { 2201 if (request_params.page_state.IsValid()) {
2202 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); 2202 render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
2203 } 2203 }
2204 } 2204 }
2205 2205
2206 bool RenderFrameHostImpl::CanExecuteJavaScript() { 2206 bool RenderFrameHostImpl::CanExecuteJavaScript() {
2207 return g_allow_injecting_javascript || 2207 return g_allow_injecting_javascript ||
2208 !frame_tree_node_->current_url().is_valid() || 2208 !frame_tree_node_->current_url().is_valid() ||
2209 frame_tree_node_->current_url().SchemeIs(kChromeDevToolsScheme) || 2209 frame_tree_node_->current_url().SchemeIs(kChromeDevToolsScheme) ||
2210 frame_tree_node_->current_url().SchemeIs(kChromeDistillerScheme) ||
2210 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 2211 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
2211 GetProcess()->GetID()) || 2212 GetProcess()->GetID()) ||
2212 // It's possible to load about:blank in a Web UI renderer. 2213 // It's possible to load about:blank in a Web UI renderer.
2213 // See http://crbug.com/42547 2214 // See http://crbug.com/42547
2214 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) || 2215 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) ||
2215 // InterstitialPageImpl should be the only case matching this. 2216 // InterstitialPageImpl should be the only case matching this.
2216 (delegate_->GetAsWebContents() == nullptr); 2217 (delegate_->GetAsWebContents() == nullptr);
2217 } 2218 }
2218 2219
2219 } // namespace content 2220 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698