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

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: frameNavigation test. Created 4 years, 1 month 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
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 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 #endif 2473 #endif
2474 #endif 2474 #endif
2475 return NULL; 2475 return NULL;
2476 } 2476 }
2477 2477
2478 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request, 2478 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request,
2479 blink::WebNavigationPolicy policy) { 2479 blink::WebNavigationPolicy policy) {
2480 loadURLExternally(request, policy, WebString(), false); 2480 loadURLExternally(request, policy, WebString(), false);
2481 } 2481 }
2482 2482
2483 void RenderFrameImpl::loadErrorPage(int reason) {
2484 blink::WebURLError error;
2485 error.unreachableURL = frame_->document().url();
2486 error.domain = WebString::fromUTF8(net::kErrorDomain);
2487 error.reason = reason;
2488
2489 std::string error_html;
2490 GetContentClient()->renderer()->GetNavigationErrorStrings(
2491 this, frame_->dataSource()->request(), error, &error_html, nullptr);
2492
2493 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2494 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
2495 error.unreachableURL, true,
2496 blink::WebFrameLoadType::Standard, blink::WebHistoryItem(),
2497 blink::WebHistoryDifferentDocumentLoad, true);
2498 }
2499
2483 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { 2500 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
2484 OnJavaScriptExecuteRequest(javascript, 0, false); 2501 OnJavaScriptExecuteRequest(javascript, 0, false);
2485 } 2502 }
2486 2503
2487 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() { 2504 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() {
2488 return interface_registry_.get(); 2505 return interface_registry_.get();
2489 } 2506 }
2490 2507
2491 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { 2508 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
2492 return remote_interfaces_.get(); 2509 return remote_interfaces_.get();
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after
6569 // event target. Potentially a Pepper plugin will receive the event. 6586 // event target. Potentially a Pepper plugin will receive the event.
6570 // In order to tell whether a plugin gets the last mouse event and which it 6587 // In order to tell whether a plugin gets the last mouse event and which it
6571 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6588 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6572 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6589 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6573 // |pepper_last_mouse_event_target_|. 6590 // |pepper_last_mouse_event_target_|.
6574 pepper_last_mouse_event_target_ = nullptr; 6591 pepper_last_mouse_event_target_ = nullptr;
6575 #endif 6592 #endif
6576 } 6593 }
6577 6594
6578 } // namespace content 6595 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698