| 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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 RecordDownloadSource(DOWNLOAD_INITIATED_BY_CONTEXT_MENU); | 1505 RecordDownloadSource(DOWNLOAD_INITIATED_BY_CONTEXT_MENU); |
| 1506 const GURL& referrer = | 1506 const GURL& referrer = |
| 1507 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; | 1507 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; |
| 1508 const GURL& url = params_.link_url; | 1508 const GURL& url = params_.link_url; |
| 1509 DownloadManager* dlm = BrowserContext::GetDownloadManager(profile_); | 1509 DownloadManager* dlm = BrowserContext::GetDownloadManager(profile_); |
| 1510 scoped_ptr<DownloadUrlParameters> dl_params( | 1510 scoped_ptr<DownloadUrlParameters> dl_params( |
| 1511 DownloadUrlParameters::FromWebContents(source_web_contents_, url)); | 1511 DownloadUrlParameters::FromWebContents(source_web_contents_, url)); |
| 1512 dl_params->set_referrer( | 1512 dl_params->set_referrer( |
| 1513 content::Referrer(referrer, params_.referrer_policy)); | 1513 content::Referrer(referrer, params_.referrer_policy)); |
| 1514 dl_params->set_referrer_encoding(params_.frame_charset); | 1514 dl_params->set_referrer_encoding(params_.frame_charset); |
| 1515 dl_params->set_suggested_name(params_.suggested_filename); |
| 1515 dl_params->set_prompt(true); | 1516 dl_params->set_prompt(true); |
| 1516 dlm->DownloadUrl(dl_params.Pass()); | 1517 dlm->DownloadUrl(dl_params.Pass()); |
| 1517 break; | 1518 break; |
| 1518 } | 1519 } |
| 1519 | 1520 |
| 1520 case IDC_CONTENT_CONTEXT_SAVEAVAS: | 1521 case IDC_CONTENT_CONTEXT_SAVEAVAS: |
| 1521 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: { | 1522 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: { |
| 1522 if (params_.media_type == WebContextMenuData::MediaTypeCanvas) { | 1523 if (params_.media_type == WebContextMenuData::MediaTypeCanvas) { |
| 1523 source_web_contents_->GetRenderViewHost()->SaveImageAt( | 1524 source_web_contents_->GetRenderViewHost()->SaveImageAt( |
| 1524 params_.x, params_.y); | 1525 params_.x, params_.y); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 source_web_contents_->GetRenderViewHost()-> | 1995 source_web_contents_->GetRenderViewHost()-> |
| 1995 ExecuteMediaPlayerActionAtLocation(location, action); | 1996 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1996 } | 1997 } |
| 1997 | 1998 |
| 1998 void RenderViewContextMenu::PluginActionAt( | 1999 void RenderViewContextMenu::PluginActionAt( |
| 1999 const gfx::Point& location, | 2000 const gfx::Point& location, |
| 2000 const WebPluginAction& action) { | 2001 const WebPluginAction& action) { |
| 2001 source_web_contents_->GetRenderViewHost()-> | 2002 source_web_contents_->GetRenderViewHost()-> |
| 2002 ExecutePluginActionAtLocation(location, action); | 2003 ExecutePluginActionAtLocation(location, action); |
| 2003 } | 2004 } |
| OLD | NEW |