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

Unified Diff: chrome/common/localized_error.cc

Issue 13737002: New network error pages: Only show an icon when in iframe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Show details instead of error code Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/renderer/resources/neterror.html » ('j') | chrome/renderer/resources/neterror.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/localized_error.cc
===================================================================
--- chrome/common/localized_error.cc (revision 193007)
+++ chrome/common/localized_error.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/common/localized_error.h"
+#include "base/base64.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/string16.h"
@@ -18,10 +19,12 @@
#include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebURLError.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/webui/web_ui_util.h"
#include "webkit/glue/webkit_glue.h"
@@ -669,6 +672,16 @@
}
error_strings->Set("suggestions", suggestions);
+
+ std::string resource_base64;
+ if (base::Base64Encode(
+ ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
+ IDR_ERROR_NETWORK_GENERIC, ui::GetMaxScaleFactor()),
+ &resource_base64)) {
+ base::StringValue* data_url =
+ new base::StringValue("data:image/png;base64," + resource_base64);
+ error_strings->Set("image", data_url);
+ }
}
string16 LocalizedError::GetErrorDetails(const WebKit::WebURLError& error) {
« no previous file with comments | « no previous file | chrome/renderer/resources/neterror.html » ('j') | chrome/renderer/resources/neterror.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698