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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1105263004: "Load image" context menu item to reload a LoFi image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try again Created 5 years, 7 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 | « chrome/renderer/chrome_content_renderer_client.h ('k') | chrome/renderer/chrome_render_frame_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 8e92dfcea4547c48ee1f72f33511004d7957dc43..7613f47b25c5cb87a0a85d85d0cef6a00b91e7a5 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -59,6 +59,7 @@
#include "components/autofill/content/renderer/password_autofill_agent.h"
#include "components/autofill/content/renderer/password_generation_agent.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/nacl/renderer/ppb_nacl_private.h"
#include "components/nacl/renderer/ppb_nacl_private_impl.h"
@@ -83,6 +84,7 @@
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLError.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
+#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebCache.h"
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -1653,3 +1655,18 @@ ChromeContentRendererClient::CreateAppBannerClient(
return scoped_ptr<blink::WebAppBannerClient>(
new AppBannerClient(render_frame));
}
+
+void ChromeContentRendererClient::AddImageContextMenuProperties(
+ const blink::WebURLResponse& response,
+ std::map<std::string, std::string>* properties) {
+ DCHECK(properties);
+ WebString header_key(ASCIIToUTF16(
+ data_reduction_proxy::chrome_proxy_header()));
+ if (!response.httpHeaderField(header_key).isNull() &&
+ response.httpHeaderField(header_key).utf8().find(
+ data_reduction_proxy::chrome_proxy_lo_fi_directive()) !=
+ std::string::npos) {
+ (*properties)[data_reduction_proxy::chrome_proxy_header()] =
+ data_reduction_proxy::chrome_proxy_lo_fi_directive();
+ }
+}
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | chrome/renderer/chrome_render_frame_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698