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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_STATS_H_
6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_STATS_H_
7 
8 #include "components/profile_metrics/browser_profile_type.h"
9 
10 class Profile;
11 
12 // This enum is used for the Bookmarks.EntryPoint histogram.
13 // These values are persisted to logs. Entries should not be renumbered and
14 // numeric values should never be reused.
15 enum BookmarkEntryPoint {
16   BOOKMARK_ENTRY_POINT_ACCELERATOR,
17   BOOKMARK_ENTRY_POINT_STAR_GESTURE,
18   BOOKMARK_ENTRY_POINT_STAR_KEY,
19   BOOKMARK_ENTRY_POINT_STAR_MOUSE,
20 
21   BOOKMARK_ENTRY_POINT_LIMIT  // Keep this last.
22 };
23 
24 // This enum is used for the Bookmarks.LaunchLocation histogram.
25 // These values are persisted to logs. Entries should not be renumbered and
26 // numeric values should never be reused.
27 enum BookmarkLaunchLocation {
28   BOOKMARK_LAUNCH_LOCATION_NONE,
29   BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR = 0,
30   // BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR = 1, (deprecated)
31   // These two are kind of sub-categories of the bookmark bar. Generally
32   // a launch from a context menu or subfolder could be classified in one of
33   // the other two bar buckets, but doing so is difficult because the menus
34   // don't know of their greater place in Chrome.
35   BOOKMARK_LAUNCH_LOCATION_BAR_SUBFOLDER = 2,
36   BOOKMARK_LAUNCH_LOCATION_CONTEXT_MENU = 3,
37 
38   // Bookmarks menu within app menu.
39   BOOKMARK_LAUNCH_LOCATION_APP_MENU = 4,
40   // Bookmark manager.
41   BOOKMARK_LAUNCH_LOCATION_MANAGER = 5,
42   // Autocomplete suggestion.
43   BOOKMARK_LAUNCH_LOCATION_OMNIBOX = 6,
44   // System application menu (e.g. on Mac).
45   BOOKMARK_LAUNCH_LOCATION_TOP_MENU = 7,
46 
47   BOOKMARK_LAUNCH_LOCATION_LIMIT  // Keep this last.
48 };
49 
50 // Records the launch of a bookmark for UMA purposes.
51 void RecordBookmarkLaunch(BookmarkLaunchLocation location,
52                           profile_metrics::BrowserProfileType profile_type);
53 
54 // Records the user launching all bookmarks in a folder (via middle-click, etc.)
55 // for UMA purposes.
56 void RecordBookmarkFolderLaunch(BookmarkLaunchLocation location);
57 
58 // Records the user opening a folder of bookmarks for UMA purposes.
59 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location);
60 
61 // Records the user opening the apps page for UMA purposes.
62 void RecordBookmarkAppsPageOpen(BookmarkLaunchLocation location);
63 
64 // Records the user adding a bookmark via star action, drag and drop, via
65 // Bookmark this tab... and Bookmark all tabs... buttons. For the Bookmark
66 // open tabs... the action is recorded only once and not as many times as
67 // count of tabs that were bookmarked.
68 void RecordBookmarksAdded(const Profile* profile);
69 
70 // Records the user bookmarking all tabs, along with the open tabs count.
71 void RecordBookmarkAllTabsWithTabsCount(const Profile* profile, int count);
72 
73 #endif  // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_STATS_H_
74