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

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: Addressing comments 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
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 ad8fee16a7ce064a1fdf89be4f3ec1648b929ef2..cc5372c7b08203859d5b365cb16ee9abca4ec458 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -81,6 +81,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"
@@ -1643,3 +1644,18 @@ void ChromeContentRendererClient::RecordRapporURL(const std::string& metric,
const GURL& url) {
RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url));
}
+
+
+void ChromeContentRendererClient::AddContextMenuProperties(
+ const blink::WebURLResponse& response,
+ std::map<std::string, std::string>* properties) {
+ DCHECK(properties);
+ const char lo_fi_header_key[] = "Chrome-Proxy";
jam 2015/05/15 06:52:19 this should really be a constant in components/dat
megjablon 2015/05/15 20:31:08 Done.
+ const char lo_fi_header_value[] = "q=low";
+ WebString header_key(ASCIIToUTF16(lo_fi_header_key));
+ if (!response.httpHeaderField(header_key).isNull() &&
+ response.httpHeaderField(header_key).utf8().find(lo_fi_header_value) !=
+ std::string::npos) {
+ (*properties)[lo_fi_header_key] = lo_fi_header_value;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698