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

Unified Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 1530393003: WIP: Move 'X-Frame-Options' checking to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar. Created 4 years, 11 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
Index: content/shell/renderer/shell_content_renderer_client.cc
diff --git a/content/shell/renderer/shell_content_renderer_client.cc b/content/shell/renderer/shell_content_renderer_client.cc
index 99badd7b4b2bd5cc13697a39aa39b9ee721796d3..66ee270c1d6efcba2a4c0eea574c67041969965f 100644
--- a/content/shell/renderer/shell_content_renderer_client.cc
+++ b/content/shell/renderer/shell_content_renderer_client.cc
@@ -5,10 +5,13 @@
#include "content/shell/renderer/shell_content_renderer_client.h"
#include "base/command_line.h"
+#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "components/web_cache/renderer/web_cache_render_process_observer.h"
#include "content/public/renderer/render_thread.h"
#include "content/shell/renderer/shell_render_view_observer.h"
#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/WebKit/public/platform/WebURLError.h"
#include "v8/include/v8.h"
#if defined(ENABLE_PLUGINS)
@@ -33,6 +36,25 @@ void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) {
new ShellRenderViewObserver(render_view);
}
+void ShellContentRendererClient::GetNavigationErrorStrings(
+ content::RenderFrame* render_frame,
+ const blink::WebURLRequest& failed_request,
+ const blink::WebURLError& error,
+ std::string* error_html,
+ base::string16* error_description) {
+ const GURL failed_url = error.unreachableURL;
+ if (error_html) {
+ *error_html = base::StringPrintf(
+ "<html><head><title>Error</title></head><body>"
+ "<h1>Error loading '%s'</h1><p>Reason code: '%d'</p></body></html>",
+ failed_url.spec().c_str(), error.reason);
+ }
+
+ if (error_description) {
+ *error_description = base::UTF8ToUTF16(base::StringPrintf("Reason: '%d'", error.reason));
+ }
+}
+
bool ShellContentRendererClient::IsPluginAllowedToUseCompositorAPI(
const GURL& url) {
#if defined(ENABLE_PLUGINS)

Powered by Google App Engine
This is Rietveld 408576698