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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 339153002: Use suggested filename for "Save Link As" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698