diff options
Diffstat (limited to 'chrome/browser/ui')
6 files changed, 80 insertions, 21 deletions
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index 58b9aea..5d408ce 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -251,23 +251,8 @@ void ChromeShellDelegate::RecordUserMetricsAction( content::RecordAction( content::UserMetricsAction("Accel_ShutDown_PowerButton")); break; - case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); - break; - case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); - break; - case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); - break; - case ash::UMA_MAXIMIZE_BUTTON_MINIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Minimize")); - break; - case ash::UMA_MAXIMIZE_BUTTON_RESTORE: - content::RecordAction(content::UserMetricsAction("MaxButton_Restore")); - break; - case ash::UMA_MAXIMIZE_BUTTON_SHOW_BUBBLE: - content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble")); + case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU: + content::RecordAction(content::UserMetricsAction("CloseFromContextMenu")); break; case ash::UMA_LAUNCHER_CLICK_ON_APP: content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp")); @@ -276,6 +261,9 @@ void ChromeShellDelegate::RecordUserMetricsAction( content::RecordAction( content::UserMetricsAction("Launcher_ClickOnApplistButton")); break; + case ash::UMA_MINIMIZE_PER_KEY: + content::RecordAction(content::UserMetricsAction("Minimize_UsingKey")); + break; case ash::UMA_MOUSE_DOWN: content::RecordAction(content::UserMetricsAction("Mouse_Down")); break; @@ -299,6 +287,44 @@ void ChromeShellDelegate::RecordUserMetricsAction( case ash::UMA_TRAY_SHUT_DOWN: content::RecordAction(content::UserMetricsAction("Tray_ShutDown")); break; + case ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK: + content::RecordAction(content::UserMetricsAction("AppCloseButton_Clk")); + break; + case ash::UMA_WINDOW_CLOSE_BUTTON_CLICK: + content::RecordAction(content::UserMetricsAction("CloseButton_Clk")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN: + content::RecordAction(content::UserMetricsAction("MaxButton_Clk_ExitFS")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE: + content::RecordAction( + content::UserMetricsAction("MaxButton_Clk_Restore")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE: + content::RecordAction( + content::UserMetricsAction("MaxButton_Clk_Maximize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE: + content::RecordAction(content::UserMetricsAction("MinButton_Clk")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE: + content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: + content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: + content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE: + content::RecordAction(content::UserMetricsAction("MaxButton_Minimize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE: + content::RecordAction(content::UserMetricsAction("MaxButton_Restore")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE: + content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble")); + break; } } diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc index 8a79bd4..0fcbf0f 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc @@ -9,6 +9,7 @@ #include "ash/desktop_background/user_wallpaper_delegate.h" #include "ash/root_window_controller.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/wm/property_util.h" #include "base/bind.h" #include "base/command_line.h" @@ -17,6 +18,7 @@ #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/ash/chrome_shell_delegate.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/common/chrome_switches.h" #include "content/public/common/context_menu_params.h" @@ -239,6 +241,8 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { break; case MENU_CLOSE: controller_->Close(item_.id); + ChromeShellDelegate::instance()->RecordUserMetricsAction( + ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); break; case MENU_PIN: controller_->TogglePinned(item_.id); diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index fee9757..6930c5e 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -376,12 +376,14 @@ void BrowserCommandController::ExecuteCommandWithDisposition( NewIncognitoWindow(browser_); break; case IDC_CLOSE_WINDOW: + content::RecordAction(content::UserMetricsAction("CloseWindowByKey")); CloseWindow(browser_); break; case IDC_NEW_TAB: NewTab(browser_); break; case IDC_CLOSE_TAB: + content::RecordAction(content::UserMetricsAction("CloseTabByKey")); CloseTab(browser_); break; case IDC_SELECT_NEXT_TAB: diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 8c690e7..d8ae5ad 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -377,6 +377,13 @@ void WrenchMenuModel::ExecuteCommand(int command_id, int event_flags) { if (command_id == IDC_HELP_PAGE_VIA_MENU) content::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu")); + if (command_id == IDC_FULLSCREEN) { + // We issue the UMA command here and not in BrowserCommandController or even + // FullscreenController since we want to be able to distinguish this event + // and a menu which is under development. + content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu")); + } + chrome::ExecuteCommand(browser_, command_id); } diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc index 51e30ab..2b1bfa7 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc @@ -4,9 +4,11 @@ #include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h" +#include "ash/shell_delegate.h" #include "ash/wm/workspace/frame_maximize_button.h" #include "base/debug/stack_trace.h" #include "base/i18n/rtl.h" +#include "chrome/browser/ui/ash/chrome_shell_delegate.h" #include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "grit/ash_resources.h" @@ -108,12 +110,17 @@ class AppNonClientFrameViewAsh::ControlView virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE { + ash::UserMetricsAction action = ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK; if (sender == close_button_) { owner_->frame()->Close(); } else if (sender == restore_button_) { + action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE; restore_button_->SetState(views::CustomButton::STATE_NORMAL); owner_->frame()->Restore(); + } else { + return; } + ChromeShellDelegate::instance()->RecordUserMetricsAction(action); } // Returns the insets of the control which are only covered by the shadow. diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index db914ec..7955e18 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc @@ -4,9 +4,11 @@ #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" +#include "ash/shell_delegate.h" #include "ash/wm/frame_painter.h" #include "ash/wm/workspace/frame_maximize_button.h" #include "chrome/browser/themes/theme_properties.h" +#include "chrome/browser/ui/ash/chrome_shell_delegate.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/avatar_menu_button.h" #include "chrome/browser/ui/views/frame/browser_frame.h" @@ -292,21 +294,32 @@ void BrowserNonClientFrameViewAsh::ButtonPressed(views::Button* sender, ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); } + ash::UserMetricsAction action = + ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE; + if (sender == size_button_) { // The maximize button may move out from under the cursor. ResetWindowControls(); - if (size_button_minimizes_) + if (size_button_minimizes_) { frame()->Minimize(); - else if (frame()->IsFullscreen()) // Can be clicked in immersive mode. + action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE; + } else if (frame()->IsFullscreen()) { // Can be clicked in immersive mode. frame()->SetFullscreen(false); - else if (frame()->IsMaximized()) + action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN; + } else if (frame()->IsMaximized()) { frame()->Restore(); - else + action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE; + } else { frame()->Maximize(); + } // |this| may be deleted - some windows delete their frames on maximize. } else if (sender == close_button_) { frame()->Close(); + action = ash::UMA_WINDOW_CLOSE_BUTTON_CLICK; + } else { + return; } + ChromeShellDelegate::instance()->RecordUserMetricsAction(action); } /////////////////////////////////////////////////////////////////////////////// |