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

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

Issue 9316116: Isolate initiation counts for downloads to their own histograms and improve (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restored curlies to original. Created 8 years, 10 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 | Annotate | Revision Log
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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" 9 #include "chrome/browser/tab_contents/render_view_context_menu.h"
10 10
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 1495
1496 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: 1496 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
1497 OpenURL(params_.link_url, 1497 OpenURL(params_.link_url,
1498 GURL(), 1498 GURL(),
1499 params_.frame_id, 1499 params_.frame_id,
1500 OFF_THE_RECORD, 1500 OFF_THE_RECORD,
1501 content::PAGE_TRANSITION_LINK); 1501 content::PAGE_TRANSITION_LINK);
1502 break; 1502 break;
1503 1503
1504 case IDC_CONTENT_CONTEXT_SAVELINKAS: { 1504 case IDC_CONTENT_CONTEXT_SAVELINKAS: {
1505 download_util::RecordDownloadCount( 1505 download_util::RecordDownloadSource(
1506 download_util::INITIATED_BY_CONTEXT_MENU_COUNT); 1506 download_util::INITIATED_BY_CONTEXT_MENU);
1507 const GURL& referrer = 1507 const GURL& referrer =
1508 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; 1508 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
1509 const GURL& url = params_.link_url; 1509 const GURL& url = params_.link_url;
1510 DownloadSaveInfo save_info; 1510 DownloadSaveInfo save_info;
1511 save_info.prompt_for_save_location = true; 1511 save_info.prompt_for_save_location = true;
1512 DownloadManager* dlm = 1512 DownloadManager* dlm =
1513 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); 1513 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager();
1514 dlm->DownloadUrl(url, 1514 dlm->DownloadUrl(url,
1515 referrer, 1515 referrer,
1516 params_.frame_charset, 1516 params_.frame_charset,
1517 false, // Don't prefer_cache 1517 false, // Don't prefer_cache
1518 -1, // No POST id 1518 -1, // No POST id
1519 save_info, 1519 save_info,
1520 source_web_contents_); 1520 source_web_contents_);
1521 break; 1521 break;
1522 } 1522 }
1523 1523
1524 case IDC_CONTENT_CONTEXT_SAVEAVAS: 1524 case IDC_CONTENT_CONTEXT_SAVEAVAS:
1525 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: { 1525 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: {
1526 download_util::RecordDownloadCount( 1526 download_util::RecordDownloadSource(
1527 download_util::INITIATED_BY_CONTEXT_MENU_COUNT); 1527 download_util::INITIATED_BY_CONTEXT_MENU);
1528 const GURL& referrer = 1528 const GURL& referrer =
1529 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; 1529 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
1530 const GURL& url = params_.src_url; 1530 const GURL& url = params_.src_url;
1531 DownloadSaveInfo save_info; 1531 DownloadSaveInfo save_info;
1532 save_info.prompt_for_save_location = true; 1532 save_info.prompt_for_save_location = true;
1533 int64 post_id = -1; 1533 int64 post_id = -1;
1534 if (url == source_web_contents_->GetURL()) { 1534 if (url == source_web_contents_->GetURL()) {
1535 const NavigationEntry* entry = 1535 const NavigationEntry* entry =
1536 source_web_contents_->GetController().GetActiveEntry(); 1536 source_web_contents_->GetController().GetActiveEntry();
1537 if (entry) 1537 if (entry)
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 source_web_contents_->GetRenderViewHost()-> 2002 source_web_contents_->GetRenderViewHost()->
2003 ExecuteMediaPlayerActionAtLocation(location, action); 2003 ExecuteMediaPlayerActionAtLocation(location, action);
2004 } 2004 }
2005 2005
2006 void RenderViewContextMenu::PluginActionAt( 2006 void RenderViewContextMenu::PluginActionAt(
2007 const gfx::Point& location, 2007 const gfx::Point& location,
2008 const WebPluginAction& action) { 2008 const WebPluginAction& action) {
2009 source_web_contents_->GetRenderViewHost()-> 2009 source_web_contents_->GetRenderViewHost()->
2010 ExecutePluginActionAtLocation(location, action); 2010 ExecutePluginActionAtLocation(location, action);
2011 } 2011 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698