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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Test. Created 4 years 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 | « content/renderer/render_frame_impl.h ('k') | net/base/net_error_list.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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 #endif 2471 #endif
2472 #endif 2472 #endif
2473 return NULL; 2473 return NULL;
2474 } 2474 }
2475 2475
2476 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request, 2476 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request,
2477 blink::WebNavigationPolicy policy) { 2477 blink::WebNavigationPolicy policy) {
2478 loadURLExternally(request, policy, WebString(), false); 2478 loadURLExternally(request, policy, WebString(), false);
2479 } 2479 }
2480 2480
2481 void RenderFrameImpl::loadErrorPage(int reason) {
2482 blink::WebURLError error;
2483 error.unreachableURL = frame_->document().url();
2484 error.domain = WebString::fromUTF8(net::kErrorDomain);
2485 error.reason = reason;
2486
2487 std::string error_html;
2488 GetContentClient()->renderer()->GetNavigationErrorStrings(
2489 this, frame_->dataSource()->request(), error, &error_html, nullptr);
2490
2491 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2492 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
2493 error.unreachableURL, true,
2494 blink::WebFrameLoadType::Standard, blink::WebHistoryItem(),
2495 blink::WebHistoryDifferentDocumentLoad, true);
2496 }
2497
2481 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { 2498 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
2482 OnJavaScriptExecuteRequest(javascript, 0, false); 2499 OnJavaScriptExecuteRequest(javascript, 0, false);
2483 } 2500 }
2484 2501
2485 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() { 2502 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() {
2486 return interface_registry_.get(); 2503 return interface_registry_.get();
2487 } 2504 }
2488 2505
2489 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { 2506 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
2490 return remote_interfaces_.get(); 2507 return remote_interfaces_.get();
(...skipping 4152 matching lines...) Expand 10 before | Expand all | Expand 10 after
6643 // event target. Potentially a Pepper plugin will receive the event. 6660 // event target. Potentially a Pepper plugin will receive the event.
6644 // In order to tell whether a plugin gets the last mouse event and which it 6661 // In order to tell whether a plugin gets the last mouse event and which it
6645 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6662 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6646 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6663 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6647 // |pepper_last_mouse_event_target_|. 6664 // |pepper_last_mouse_event_target_|.
6648 pepper_last_mouse_event_target_ = nullptr; 6665 pepper_last_mouse_event_target_ = nullptr;
6649 #endif 6666 #endif
6650 } 6667 }
6651 6668
6652 } // namespace content 6669 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698