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

Side by Side 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: All comments and move Chrome-Proxy logic outside of content/ 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "content/public/renderer/render_view.h" 74 #include "content/public/renderer/render_view.h"
75 #include "content/public/renderer/render_view_visitor.h" 75 #include "content/public/renderer/render_view_visitor.h"
76 #include "extensions/common/constants.h" 76 #include "extensions/common/constants.h"
77 #include "ipc/ipc_sync_channel.h" 77 #include "ipc/ipc_sync_channel.h"
78 #include "net/base/net_errors.h" 78 #include "net/base/net_errors.h"
79 #include "ppapi/c/private/ppb_pdf.h" 79 #include "ppapi/c/private/ppb_pdf.h"
80 #include "ppapi/shared_impl/ppapi_switches.h" 80 #include "ppapi/shared_impl/ppapi_switches.h"
81 #include "third_party/WebKit/public/platform/WebURL.h" 81 #include "third_party/WebKit/public/platform/WebURL.h"
82 #include "third_party/WebKit/public/platform/WebURLError.h" 82 #include "third_party/WebKit/public/platform/WebURLError.h"
83 #include "third_party/WebKit/public/platform/WebURLRequest.h" 83 #include "third_party/WebKit/public/platform/WebURLRequest.h"
84 #include "third_party/WebKit/public/platform/WebURLResponse.h"
84 #include "third_party/WebKit/public/web/WebCache.h" 85 #include "third_party/WebKit/public/web/WebCache.h"
85 #include "third_party/WebKit/public/web/WebDataSource.h" 86 #include "third_party/WebKit/public/web/WebDataSource.h"
86 #include "third_party/WebKit/public/web/WebDocument.h" 87 #include "third_party/WebKit/public/web/WebDocument.h"
87 #include "third_party/WebKit/public/web/WebElement.h" 88 #include "third_party/WebKit/public/web/WebElement.h"
88 #include "third_party/WebKit/public/web/WebLocalFrame.h" 89 #include "third_party/WebKit/public/web/WebLocalFrame.h"
89 #include "third_party/WebKit/public/web/WebPluginContainer.h" 90 #include "third_party/WebKit/public/web/WebPluginContainer.h"
90 #include "third_party/WebKit/public/web/WebPluginParams.h" 91 #include "third_party/WebKit/public/web/WebPluginParams.h"
91 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" 92 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h"
92 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 93 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
93 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 94 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1637
1637 void ChromeContentRendererClient::RecordRappor(const std::string& metric, 1638 void ChromeContentRendererClient::RecordRappor(const std::string& metric,
1638 const std::string& sample) { 1639 const std::string& sample) {
1639 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); 1640 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample));
1640 } 1641 }
1641 1642
1642 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, 1643 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric,
1643 const GURL& url) { 1644 const GURL& url) {
1644 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); 1645 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url));
1645 } 1646 }
1647
1648
1649 void ChromeContentRendererClient::AddContextMenuProperties(
1650 const blink::WebURLResponse& response,
1651 std::map<std::string, std::string>* properties) {
1652 DCHECK(properties);
1653 const char lo_fi_header_key[] = "Chrome-Proxy";
Lei Zhang 2015/05/13 23:50:19 Aren't the same values also seen in RenderViewCont
megjablon 2015/05/14 19:26:25 They're used little different in DRPRequestOptions
1654 const char lo_fi_header_value[] = "q=low";
1655 WebString header_key(ASCIIToUTF16(lo_fi_header_key));
1656 if (!response.httpHeaderField(header_key).isNull() &&
1657 response.httpHeaderField(header_key).utf8().find(lo_fi_header_value) !=
1658 std::string::npos) {
1659 (*properties)[lo_fi_header_key] = lo_fi_header_value;
1660 }
1661 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698