diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 15:03:21 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 15:03:21 +0000 |
commit | 481fe3bfb2359849d1d3fc9d0ceba4161fbb5a3e (patch) | |
tree | 7e7cf826ebe2e9cc39c845eb6a33747a4ad37029 /chrome/browser | |
parent | c6619189d9d7176f62754fce548cdcedf8831bcf (diff) | |
download | chromium_src-481fe3bfb2359849d1d3fc9d0ceba4161fbb5a3e.zip chromium_src-481fe3bfb2359849d1d3fc9d0ceba4161fbb5a3e.tar.gz chromium_src-481fe3bfb2359849d1d3fc9d0ceba4161fbb5a3e.tar.bz2 |
Record UI metric for closing tabs with the mouse.
Review URL: http://codereview.chromium.org/114021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index c4c26c0..237e520 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -8,6 +8,7 @@ #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" +#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profile.h" #import "chrome/browser/cocoa/tab_strip_view.h" #import "chrome/browser/cocoa/tab_cell.h" @@ -123,15 +124,19 @@ // Called when the user closes a tab. Asks the model to close the tab. - (void)closeTab:(id)sender { - if ([self numberOfTabViews] > 1) { - int index = [self indexForTabView:sender]; - if (index >= 0 && tabModel_->ContainsIndex(index)) + int index = [self indexForTabView:sender]; + if (tabModel_->ContainsIndex(index)) { + TabContents* contents = tabModel_->GetTabContentsAt(index); + if (contents) + UserMetrics::RecordAction(L"CloseTab_Mouse", contents->profile()); + if ([self numberOfTabViews] > 1) { tabModel_->CloseTabContentsAt(index); - } else { - // Use the standard window close if this is the last tab - // this prevents the tab from being removed from the model until after - // the window dissapears - [[tabView_ window] performClose:nil]; + } else { + // Use the standard window close if this is the last tab + // this prevents the tab from being removed from the model until after + // the window dissapears + [[tabView_ window] performClose:nil]; + } } } |