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

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: 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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_SAVEAVAS: 1487 case IDC_CONTENT_CONTEXT_SAVEAVAS:
1488 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: 1488 case IDC_CONTENT_CONTEXT_SAVEIMAGEAS:
1489 case IDC_CONTENT_CONTEXT_SAVELINKAS: { 1489 case IDC_CONTENT_CONTEXT_SAVELINKAS: {
1490 download_util::RecordDownloadCount( 1490 download_util::RecordDownloadSource(
1491 download_util::INITIATED_BY_CONTEXT_MENU_COUNT); 1491 download_util::INITIATED_BY_CONTEXT_MENU);
1492 const GURL& referrer = 1492 const GURL& referrer =
1493 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url; 1493 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
1494 const GURL& url = 1494 const GURL& url =
1495 (id == IDC_CONTENT_CONTEXT_SAVELINKAS ? params_.link_url : 1495 (id == IDC_CONTENT_CONTEXT_SAVELINKAS ? params_.link_url :
1496 params_.src_url); 1496 params_.src_url);
1497 DownloadManager* dlm = 1497 DownloadManager* dlm =
1498 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); 1498 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager();
1499 // For images and AV "Save As" context menu commands, save the cached 1499 // For images and AV "Save As" context menu commands, save the cached
1500 // data even if it is no longer valid. This helps ensure that the content 1500 // data even if it is no longer valid. This helps ensure that the content
1501 // that is visible on the page is what is saved. For links, this behavior 1501 // that is visible on the page is what is saved. For links, this behavior
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 source_web_contents_->GetRenderViewHost()-> 1945 source_web_contents_->GetRenderViewHost()->
1946 ExecuteMediaPlayerActionAtLocation(location, action); 1946 ExecuteMediaPlayerActionAtLocation(location, action);
1947 } 1947 }
1948 1948
1949 void RenderViewContextMenu::PluginActionAt( 1949 void RenderViewContextMenu::PluginActionAt(
1950 const gfx::Point& location, 1950 const gfx::Point& location,
1951 const WebPluginAction& action) { 1951 const WebPluginAction& action) {
1952 source_web_contents_->GetRenderViewHost()-> 1952 source_web_contents_->GetRenderViewHost()->
1953 ExecutePluginActionAtLocation(location, action); 1953 ExecutePluginActionAtLocation(location, action);
1954 } 1954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698