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

Side by Side Diff: chrome/browser/bookmarks/bookmark_stats.cc

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bookmarks/bookmark_stats.h" 5 #include "chrome/browser/bookmarks/bookmark_stats.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/user_metrics.h"
8 #include "components/bookmarks/browser/bookmark_model.h" 9 #include "components/bookmarks/browser/bookmark_model.h"
9 #include "content/public/browser/user_metrics.h"
10 10
11 using bookmarks::BookmarkNode; 11 using bookmarks::BookmarkNode;
12 12
13 void RecordBookmarkLaunch(const BookmarkNode* node, 13 void RecordBookmarkLaunch(const BookmarkNode* node,
14 BookmarkLaunchLocation location) { 14 BookmarkLaunchLocation location) {
15 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || 15 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR ||
16 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { 16 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) {
17 content::RecordAction( 17 base::RecordAction(base::UserMetricsAction("ClickedBookmarkBarURLButton"));
18 base::UserMetricsAction("ClickedBookmarkBarURLButton"));
19 } 18 }
20 UMA_HISTOGRAM_ENUMERATION( 19 UMA_HISTOGRAM_ENUMERATION(
21 "Bookmarks.LaunchLocation", location, BOOKMARK_LAUNCH_LOCATION_LIMIT); 20 "Bookmarks.LaunchLocation", location, BOOKMARK_LAUNCH_LOCATION_LIMIT);
22 21
23 if (!node) 22 if (!node)
24 return; 23 return;
25 24
26 // In the cases where a bookmark node is provided, record the depth of the 25 // In the cases where a bookmark node is provided, record the depth of the
27 // bookmark in the tree. 26 // bookmark in the tree.
28 int depth = 0; 27 int depth = 0;
29 for (const BookmarkNode* iter = node; iter != NULL; iter = iter->parent()) { 28 for (const BookmarkNode* iter = node; iter != NULL; iter = iter->parent()) {
30 depth++; 29 depth++;
31 } 30 }
32 // Record |depth - 2| to offset the invisible root node and permanent nodes 31 // Record |depth - 2| to offset the invisible root node and permanent nodes
33 // (Bookmark Bar, Mobile Bookmarks or Other Bookmarks) 32 // (Bookmark Bar, Mobile Bookmarks or Other Bookmarks)
34 UMA_HISTOGRAM_COUNTS("Bookmarks.LaunchDepth", depth - 2); 33 UMA_HISTOGRAM_COUNTS("Bookmarks.LaunchDepth", depth - 2);
35 } 34 }
36 35
37 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location) { 36 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location) {
38 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || 37 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR ||
39 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { 38 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) {
40 content::RecordAction( 39 base::RecordAction(base::UserMetricsAction("ClickedBookmarkBarFolder"));
41 base::UserMetricsAction("ClickedBookmarkBarFolder"));
42 } 40 }
43 } 41 }
44 42
45 void RecordBookmarkAppsPageOpen(BookmarkLaunchLocation location) { 43 void RecordBookmarkAppsPageOpen(BookmarkLaunchLocation location) {
46 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || 44 if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR ||
47 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { 45 location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) {
48 content::RecordAction( 46 base::RecordAction(
49 base::UserMetricsAction("ClickedBookmarkBarAppsShortcutButton")); 47 base::UserMetricsAction("ClickedBookmarkBarAppsShortcutButton"));
50 } 48 }
51 } 49 }
OLDNEW
« no previous file with comments | « chrome/browser/background/background_mode_manager.cc ('k') | chrome/browser/bookmarks/chrome_bookmark_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698