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

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: Merged to TOT. 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 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 1478
1479 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: 1479 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
1480 OpenURL(params_.link_url, 1480 OpenURL(params_.link_url,
1481 GURL(), 1481 GURL(),
1482 params_.frame_id, 1482 params_.frame_id,
1483 OFF_THE_RECORD, 1483 OFF_THE_RECORD,
1484 content::PAGE_TRANSITION_LINK); 1484 content::PAGE_TRANSITION_LINK);
1485 break; 1485 break;
1486 1486
1487 case IDC_CONTENT_CONTEXT_SAVELINKAS: { 1487 case IDC_CONTENT_CONTEXT_SAVELINKAS: {
1488 download_util::RecordDownloadCount( 1488 download_util::RecordDownloadSource(
1489 download_util::INITIATED_BY_CONTEXT_MENU_COUNT); 1489 download_util::INITIATED_BY_CONTEXT_MENU);
1490 const GURL& referrer = 1490 const GURL& referrer =
1491 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; 1491 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
1492 const GURL& url = params_.link_url; 1492 const GURL& url = params_.link_url;
1493 DownloadSaveInfo save_info; 1493 DownloadSaveInfo save_info;
1494 save_info.prompt_for_save_location = true; 1494 save_info.prompt_for_save_location = true;
1495 DownloadManager* dlm = 1495 DownloadManager* dlm =
1496 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); 1496 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager();
1497 dlm->DownloadUrl(url, 1497 dlm->DownloadUrl(url,
1498 referrer, 1498 referrer,
1499 params_.frame_charset, 1499 params_.frame_charset,
1500 false, // Don't prefer_cache 1500 false, // Don't prefer_cache
1501 -1, // No POST id 1501 -1, // No POST id
1502 save_info, 1502 save_info,
1503 source_web_contents_); 1503 source_web_contents_);
1504 break; 1504 break;
1505 } 1505 }
1506 1506
1507 case IDC_CONTENT_CONTEXT_SAVEAVAS: 1507 case IDC_CONTENT_CONTEXT_SAVEAVAS:
1508 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: { 1508 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: {
1509 download_util::RecordDownloadCount( 1509 download_util::RecordDownloadSource(
1510 download_util::INITIATED_BY_CONTEXT_MENU_COUNT); 1510 download_util::INITIATED_BY_CONTEXT_MENU);
1511 const GURL& referrer = 1511 const GURL& referrer =
1512 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; 1512 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
1513 const GURL& url = params_.src_url; 1513 const GURL& url = params_.src_url;
1514 DownloadSaveInfo save_info; 1514 DownloadSaveInfo save_info;
1515 save_info.prompt_for_save_location = true; 1515 save_info.prompt_for_save_location = true;
1516 int64 post_id = -1; 1516 int64 post_id = -1;
1517 if (url == source_web_contents_->GetURL()) { 1517 if (url == source_web_contents_->GetURL()) {
1518 const NavigationEntry* entry = 1518 const NavigationEntry* entry =
1519 source_web_contents_->GetController().GetActiveEntry(); 1519 source_web_contents_->GetController().GetActiveEntry();
1520 if (entry) 1520 if (entry)
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 source_web_contents_->GetRenderViewHost()-> 1969 source_web_contents_->GetRenderViewHost()->
1970 ExecuteMediaPlayerActionAtLocation(location, action); 1970 ExecuteMediaPlayerActionAtLocation(location, action);
1971 } 1971 }
1972 1972
1973 void RenderViewContextMenu::PluginActionAt( 1973 void RenderViewContextMenu::PluginActionAt(
1974 const gfx::Point& location, 1974 const gfx::Point& location,
1975 const WebPluginAction& action) { 1975 const WebPluginAction& action) {
1976 source_web_contents_->GetRenderViewHost()-> 1976 source_web_contents_->GetRenderViewHost()->
1977 ExecutePluginActionAtLocation(location, action); 1977 ExecutePluginActionAtLocation(location, action);
1978 } 1978 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698