Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1383 params_.src_url.is_empty(); | 1383 params_.src_url.is_empty(); |
| 1384 if (params_.media_type == WebContextMenuData::MediaTypeCanvas || | 1384 if (params_.media_type == WebContextMenuData::MediaTypeCanvas || |
| 1385 (params_.media_type == WebContextMenuData::MediaTypeImage && | 1385 (params_.media_type == WebContextMenuData::MediaTypeImage && |
| 1386 is_large_data_url)) { | 1386 is_large_data_url)) { |
| 1387 source_web_contents_->GetRenderViewHost()->SaveImageAt( | 1387 source_web_contents_->GetRenderViewHost()->SaveImageAt( |
| 1388 params_.x, params_.y); | 1388 params_.x, params_.y); |
| 1389 } else { | 1389 } else { |
| 1390 RecordDownloadSource(DOWNLOAD_INITIATED_BY_CONTEXT_MENU); | 1390 RecordDownloadSource(DOWNLOAD_INITIATED_BY_CONTEXT_MENU); |
| 1391 const GURL& url = params_.src_url; | 1391 const GURL& url = params_.src_url; |
| 1392 content::Referrer referrer = CreateSaveAsReferrer(url, params_); | 1392 content::Referrer referrer = CreateSaveAsReferrer(url, params_); |
| 1393 source_web_contents_->SaveFrame(url, referrer); | 1393 |
| 1394 std::string header = ""; | |
|
Avi (use Gerrit)
2015/03/05 20:35:39
Drop the assignment; strings are constructed empty
Not at Google. Contact bengr
2015/03/06 22:23:48
Done.
| |
| 1395 if (!browser_context_->IsOffTheRecord() && | |
|
Avi (use Gerrit)
2015/03/05 20:35:39
I'm not thrilled with the idea of using the knowle
Not at Google. Contact bengr
2015/03/06 22:23:48
Unfortunately, DataReductionProxyChromeSettingsFac
Avi (use Gerrit)
2015/03/06 23:55:20
This is even weirder then. I'm assuming that there
Not at Google. Contact bengr
2015/03/07 00:45:02
Done.
Even though DataReductionProxyChromeSetting
| |
| 1396 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( | |
| 1397 browser_context_)->CanUseDataReductionProxy( | |
| 1398 params_.src_url)) { | |
| 1399 header = data_reduction_proxy::kDataReductionPassThroughHeader; | |
| 1400 } | |
| 1401 | |
| 1402 source_web_contents_->SaveFrameWithHeader(url, referrer, header); | |
| 1394 } | 1403 } |
| 1395 break; | 1404 break; |
| 1396 } | 1405 } |
| 1397 | 1406 |
| 1398 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: | 1407 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: |
| 1399 WriteURLToClipboard(params_.unfiltered_link_url); | 1408 WriteURLToClipboard(params_.unfiltered_link_url); |
| 1400 break; | 1409 break; |
| 1401 | 1410 |
| 1402 case IDC_CONTENT_CONTEXT_COPYIMAGELOCATION: | 1411 case IDC_CONTENT_CONTEXT_COPYIMAGELOCATION: |
| 1403 case IDC_CONTENT_CONTEXT_COPYAVLOCATION: | 1412 case IDC_CONTENT_CONTEXT_COPYAVLOCATION: |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1804 source_web_contents_->GetRenderViewHost()-> | 1813 source_web_contents_->GetRenderViewHost()-> |
| 1805 ExecuteMediaPlayerActionAtLocation(location, action); | 1814 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1806 } | 1815 } |
| 1807 | 1816 |
| 1808 void RenderViewContextMenu::PluginActionAt( | 1817 void RenderViewContextMenu::PluginActionAt( |
| 1809 const gfx::Point& location, | 1818 const gfx::Point& location, |
| 1810 const WebPluginAction& action) { | 1819 const WebPluginAction& action) { |
| 1811 source_web_contents_->GetRenderViewHost()-> | 1820 source_web_contents_->GetRenderViewHost()-> |
| 1812 ExecutePluginActionAtLocation(location, action); | 1821 ExecutePluginActionAtLocation(location, action); |
| 1813 } | 1822 } |
| OLD | NEW |