diff options
author | edwardjung <edwardjung@chromium.org> | 2014-11-18 03:47:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-18 11:47:45 +0000 |
commit | b8dde40da782604227baee3cd28c774920a13470 (patch) | |
tree | b335128f4a19bcb2fc4fffc9f528aaea5210c366 /chrome/browser/ui/toolbar/wrench_menu_model.h | |
parent | e290fe097bb6ee75c289b512efad07a1d2830489 (diff) | |
download | chromium_src-b8dde40da782604227baee3cd28c774920a13470.zip chromium_src-b8dde40da782604227baee3cd28c774920a13470.tar.gz chromium_src-b8dde40da782604227baee3cd28c774920a13470.tar.bz2 |
Added histograms:
+ count frequency of use for each of the menu items.
+ log time taken to get to any menu item.
+ time taken to get to individual menu items.
BUG=432561
Review URL: https://codereview.chromium.org/700673003
Cr-Commit-Position: refs/heads/master@{#304586}
Diffstat (limited to 'chrome/browser/ui/toolbar/wrench_menu_model.h')
-rw-r--r-- | chrome/browser/ui/toolbar/wrench_menu_model.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h index ff787c8..4b9cefe 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.h +++ b/chrome/browser/ui/toolbar/wrench_menu_model.h @@ -7,6 +7,8 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" +#include "base/time/time.h" +#include "base/timer/elapsed_timer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "content/public/browser/host_zoom_map.h" #include "content/public/browser/notification_observer.h" @@ -24,6 +26,54 @@ namespace { class MockWrenchMenuModel; } // namespace +enum WrenchMenuAction { + MENU_ACTION_NEW_TAB = 0, + MENU_ACTION_NEW_WINDOW, + MENU_ACTION_NEW_INCOGNITO_WINDOW, + MENU_ACTION_SHOW_BOOKMARK_BAR, + MENU_ACTION_SHOW_BOOKMARK_MANAGER, + MENU_ACTION_IMPORT_SETTINGS, + MENU_ACTION_BOOKMARK_PAGE, + MENU_ACTION_BOOKMARK_ALL_TABS, + MENU_ACTION_PIN_TO_START_SCREEN, + MENU_ACTION_RESTORE_TAB, + MENU_ACTION_WIN_DESKTOP_RESTART, + MENU_ACTION_WIN8_METRO_RESTART, + MENU_ACTION_WIN_CHROMEOS_RESTART, + MENU_ACTION_DISTILL_PAGE, + MENU_ACTION_SAVE_PAGE, + MENU_ACTION_FIND, + MENU_ACTION_PRINT, + MENU_ACTION_CUT, + MENU_ACTION_COPY, + MENU_ACTION_PASTE, + MENU_ACTION_CREATE_HOSTED_APP, + MENU_ACTION_CREATE_SHORTCUTS, + MENU_ACTION_MANAGE_EXTENSIONS, + MENU_ACTION_TASK_MANAGER, + MENU_ACTION_CLEAR_BROWSING_DATA, + MENU_ACTION_VIEW_SOURCE, + MENU_ACTION_DEV_TOOLS, + MENU_ACTION_DEV_TOOLS_CONSOLE, + MENU_ACTION_DEV_TOOLS_DEVICES, + MENU_ACTION_PROFILING_ENABLED, + MENU_ACTION_ZOOM_MINUS, + MENU_ACTION_ZOOM_PLUS, + MENU_ACTION_FULLSCREEN, + MENU_ACTION_SHOW_HISTORY, + MENU_ACTION_SHOW_DOWNLOADS, + MENU_ACTION_SHOW_SYNC_SETUP, + MENU_ACTION_OPTIONS, + MENU_ACTION_ABOUT, + MENU_ACTION_HELP_PAGE_VIA_MENU, + MENU_ACTION_FEEDBACK, + MENU_ACTION_TOGGLE_REQUEST_TABLET_SITE, + MENU_ACTION_EXIT, + MENU_ACTION_RECENT_TAB, + MENU_ACTION_BOOKMARK_OPEN, + LIMIT_MENU_ACTION +}; + // A menu model that builds the contents of an encoding menu. class EncodingMenuModel : public ui::SimpleMenuModel, public ui::SimpleMenuModel::Delegate { @@ -157,6 +207,23 @@ class WrenchMenuModel : public ui::SimpleMenuModel, bool ShouldShowNewIncognitoWindowMenuItem(); + // Called when a command is selected. + // Logs UMA metrics about which command was chosen and how long the user + // took to select the command. + void LogMenuMetrics(int command_id); + + // Helper function to record the menu action in a UMA histogram. + void LogMenuAction(int action_id); + + // Time menu has been open. Used by LogMenuMetrics() to record the time + // to action when the user selects a menu item. + base::ElapsedTimer timer_; + + // Whether a UMA menu action has been recorded since the menu is open. + // Only the first time to action is recorded since some commands + // (zoom controls) don't dimiss the menu. + bool uma_action_recorded_; + // Models for the special menu items with buttons. scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; |