Commit fd61abca authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Clean up tab grid metrics

This CL cleans up tab grid metric names and regularizes how they are called.

All tab grid metrics are now named "TabGrid*". "Regular" is used instead of "NonIncognito" in metric names. Straightforward renames are as follows:

(All of the original names for these metrics were defined in the internal actions.xml file and will be obsoleted)
  MobileStackViewCloseTab -> MobileTabGridCloseControlTapped
  MobileTabSwitcherHeaderViewSelectDistantSessionPanel -> MobileTabGridSelectRemotePanel
  MobileTabSwitcherOpenNonIncognitoTab -> MobileTabGridOpenRegularTab
  MobileTabSwitcherOpenIncognitoTab -> MobileTabGridOpenIncognitoTab
  MobileTabSwitcherCloseNonIncognitoTab -> MobileTabGridCloseRegularTab
  MobileTabSwitcherCloseIncognitoTab -> MobileTabGridCloseIncognitoTab
  MobileTabReturnedToCurrentTab -> MobileTabGridDone

(The original names for these metrics were not defined anywhere!)
  MobileTabSwitcherPresented -> MobileTabGridEntered
  MobileTabSwitcherDismissed -> MobileTabGridExited

Some metrics that were tracked separately in the old stack view and table tab switcher are here consolidated into a single metric:

MobileTabSwitcherHeaderViewSelectIncognitoPanel, MobileStackViewIncognitoMode -> MobileTabGridSelectIncognitoPanel
MobileTabSwitcherHeaderViewSelectNonIncognitoPanel,  MobileStackViewNormalMode -> MobileTabGridSelectRegularPanel

The metrics for tab creation are now separated to distinguish use of the new tab button and the keyboard shortcuts. The relevant code is also restructured for this.

  MobileTabSwitcherCreateNonIncognitoTab -> MobileTabGridCreateRegularTab, MobileTabGridCreateRegularTabKeyboard
  MobileTabSwitcherCreateIncognitoTab -> MobileTabGridCreateIncognitoTab, MobileTabGridCreateRegularTabKeyboard

Bug: 856965
Change-Id: I3d78e2bb27ce2db46a4b4e7a1c32017742fcc514
Reviewed-on: https://chromium-review.googlesource.com/c/1475486
Auto-Submit: Mark Cogan <marq@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635745}
parent e28ca933
...@@ -329,8 +329,8 @@ NSIndexPath* CreateIndexPath(NSInteger index) { ...@@ -329,8 +329,8 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
[self.delegate gridViewController:self [self.delegate gridViewController:self
didCloseItemWithID:cell.itemIdentifier]; didCloseItemWithID:cell.itemIdentifier];
// Record when a tab is closed via the X. // Record when a tab is closed via the X.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(
base::RecordAction(base::UserMetricsAction("MobileStackViewCloseTab")); base::UserMetricsAction("MobileTabGridCloseControlTapped"));
} }
#pragma mark - GridConsumer #pragma mark - GridConsumer
......
...@@ -285,8 +285,7 @@ ...@@ -285,8 +285,7 @@
completion:nil]; completion:nil];
} }
// Record when the tab switcher is presented. // Record when the tab switcher is presented.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(base::UserMetricsAction("MobileTabGridEntered"));
base::RecordAction(base::UserMetricsAction("MobileTabSwitcherPresented"));
} }
- (void)showTabViewController:(UIViewController*)viewController - (void)showTabViewController:(UIViewController*)viewController
...@@ -294,8 +293,7 @@ ...@@ -294,8 +293,7 @@
DCHECK(viewController); DCHECK(viewController);
// Record when the tab switcher is dismissed. // Record when the tab switcher is dismissed.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(base::UserMetricsAction("MobileTabGridExited"));
base::RecordAction(base::UserMetricsAction("MobileTabSwitcherDismissed"));
// If another BVC is already being presented, swap this one into the // If another BVC is already being presented, swap this one into the
// container. // container.
......
...@@ -910,25 +910,19 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -910,25 +910,19 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// There are duplicate metrics below that correspond to the previous // There are duplicate metrics below that correspond to the previous
// separate implementations for iPhone and iPad. Having both allow for // separate implementations for iPhone and iPad. Having both allow for
// comparisons to the previous implementations. // comparisons to the previous implementations.
// TODO(crbug.com/856965) : Consolidate and rename metrics.
base::RecordAction( base::RecordAction(
base::UserMetricsAction("MobileStackViewIncognitoMode")); base::UserMetricsAction("MobileTabGridSelectIncognitoPanel"));
base::RecordAction(base::UserMetricsAction(
"MobileTabSwitcherHeaderViewSelectIncognitoPanel"));
break; break;
case TabGridPageRegularTabs: case TabGridPageRegularTabs:
// There are duplicate metrics below that correspond to the previous // There are duplicate metrics below that correspond to the previous
// separate implementations for iPhone and iPad. Having both allow for // separate implementations for iPhone and iPad. Having both allow for
// comparisons to the previous implementations. // comparisons to the previous implementations.
// TODO(crbug.com/856965) : Consolidate and rename metrics. base::RecordAction(
base::RecordAction(base::UserMetricsAction("MobileStackViewNormalMode")); base::UserMetricsAction("MobileTabGridSelectRegularPanel"));
base::RecordAction(base::UserMetricsAction(
"MobileTabSwitcherHeaderViewSelectNonIncognitoPanel"));
break; break;
case TabGridPageRemoteTabs: case TabGridPageRemoteTabs:
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(
base::RecordAction(base::UserMetricsAction( base::UserMetricsAction("MobileTabGridSelectRemotePanel"));
"MobileTabSwitcherHeaderViewSelectDistantSessionPanel"));
break; break;
} }
switch (self.pageChangeInteraction) { switch (self.pageChangeInteraction) {
...@@ -960,18 +954,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -960,18 +954,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
case TabGridPageIncognitoTabs: case TabGridPageIncognitoTabs:
[self.incognitoTabsViewController prepareForDismissal]; [self.incognitoTabsViewController prepareForDismissal];
[self.incognitoTabsDelegate addNewItem]; [self.incognitoTabsDelegate addNewItem];
// Record when new incognito tab is created.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCreateIncognitoTab"));
break; break;
case TabGridPageRegularTabs: case TabGridPageRegularTabs:
[self.regularTabsViewController prepareForDismissal]; [self.regularTabsViewController prepareForDismissal];
[self.regularTabsDelegate addNewItem]; [self.regularTabsDelegate addNewItem];
// Record when new regular tab is created.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCreateNonIncognitoTab"));
break; break;
case TabGridPageRemoteTabs: case TabGridPageRemoteTabs:
NOTREACHED() << "It is invalid to have an active tab in remote tabs."; NOTREACHED() << "It is invalid to have an active tab in remote tabs.";
...@@ -985,19 +971,30 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -985,19 +971,30 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// Creates and shows a new regular tab. // Creates and shows a new regular tab.
- (void)openNewRegularTabForKeyboardCommand { - (void)openNewRegularTabForKeyboardCommand {
[self openNewTabInPage:TabGridPageRegularTabs focusOmnibox:YES]; [self openNewTabInPage:TabGridPageRegularTabs focusOmnibox:YES];
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateRegularTabKeyboard"));
} }
// Creates and shows a new incognito tab. // Creates and shows a new incognito tab.
- (void)openNewIncognitoTabForKeyboardCommand { - (void)openNewIncognitoTabForKeyboardCommand {
[self openNewTabInPage:TabGridPageIncognitoTabs focusOmnibox:YES]; [self openNewTabInPage:TabGridPageIncognitoTabs focusOmnibox:YES];
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateIncognitoTabKeyboard"));
} }
// Creates and shows a new tab in the current page. // Creates and shows a new tab in the current page.
- (void)openNewTabInCurrentPageForKeyboardCommand { - (void)openNewTabInCurrentPageForKeyboardCommand {
// Tabs cannot be opened with ⌘-t from the remote tabs page. switch (self.currentPage) {
if (self.currentPage == TabGridPageRemoteTabs) case TabGridPageIncognitoTabs:
return; [self openNewIncognitoTabForKeyboardCommand];
[self openNewTabInPage:self.currentPage focusOmnibox:YES]; break;
case TabGridPageRegularTabs:
[self openNewRegularTabForKeyboardCommand];
break;
case TabGridPageRemoteTabs:
// Tabs cannot be opened with ⌘-t from the remote tabs page.
break;
}
} }
// Broadcasts whether incognito tabs are showing. // Broadcasts whether incognito tabs are showing.
...@@ -1046,15 +1043,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -1046,15 +1043,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
if (gridViewController == self.regularTabsViewController) { if (gridViewController == self.regularTabsViewController) {
[self.regularTabsDelegate selectItemWithID:itemID]; [self.regularTabsDelegate selectItemWithID:itemID];
// Record when a regular tab is opened. // Record when a regular tab is opened.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(base::UserMetricsAction("MobileTabGridOpenRegularTab"));
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherOpenNonIncognitoTab"));
} else if (gridViewController == self.incognitoTabsViewController) { } else if (gridViewController == self.incognitoTabsViewController) {
[self.incognitoTabsDelegate selectItemWithID:itemID]; [self.incognitoTabsDelegate selectItemWithID:itemID];
// Record when an incognito tab is opened. // Record when an incognito tab is opened.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction( base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab")); base::UserMetricsAction("MobileTabGridOpenIncognitoTab"));
} }
self.activePage = self.currentPage; self.activePage = self.currentPage;
[self.tabPresentationDelegate showActiveTabInPage:self.currentPage [self.tabPresentationDelegate showActiveTabInPage:self.currentPage
...@@ -1067,15 +1061,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -1067,15 +1061,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
if (gridViewController == self.regularTabsViewController) { if (gridViewController == self.regularTabsViewController) {
[self.regularTabsDelegate closeItemWithID:itemID]; [self.regularTabsDelegate closeItemWithID:itemID];
// Record when a regular tab is closed. // Record when a regular tab is closed.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(base::UserMetricsAction("MobileTabGridCloseRegularTab"));
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab"));
} else if (gridViewController == self.incognitoTabsViewController) { } else if (gridViewController == self.incognitoTabsViewController) {
[self.incognitoTabsDelegate closeItemWithID:itemID]; [self.incognitoTabsDelegate closeItemWithID:itemID];
// Record when an incognito tab is closed. // Record when an incognito tab is closed.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction( base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab")); base::UserMetricsAction("MobileTabGridCloseIncognitoTab"));
} }
} }
...@@ -1144,9 +1135,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -1144,9 +1135,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
focusOmnibox:NO]; focusOmnibox:NO];
// Record when users exit the tab grid to return to the current foreground // Record when users exit the tab grid to return to the current foreground
// tab. // tab.
// TODO(crbug.com/856965) : Rename metrics. base::RecordAction(base::UserMetricsAction("MobileTabGridDone"));
base::RecordAction(
base::UserMetricsAction("MobileTabReturnedToCurrentTab"));
} }
} }
...@@ -1180,9 +1169,20 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -1180,9 +1169,20 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
- (void)newTabButtonTapped:(id)sender { - (void)newTabButtonTapped:(id)sender {
[self openNewTabInPage:self.currentPage focusOmnibox:NO]; [self openNewTabInPage:self.currentPage focusOmnibox:NO];
// Record only when a new tab is created through the + button. // Record metrics for button taps
// TODO(crbug.com/856965) : Rename metrics. switch (self.currentPage) {
base::RecordAction(base::UserMetricsAction("MobileToolbarStackViewNewTab")); case TabGridPageIncognitoTabs:
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateIncognitoTab"));
break;
case TabGridPageRegularTabs:
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateRegularTab"));
break;
case TabGridPageRemoteTabs:
// No-op.
break;
}
} }
- (void)pageControlChangedValue:(id)sender { - (void)pageControlChangedValue:(id)sender {
......
...@@ -12385,6 +12385,67 @@ should be able to be added at any place in this file. ...@@ -12385,6 +12385,67 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="MobileTabGridCloseControlTapped">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid tapped on the close control of a tab.
</description>
</action>
<action name="MobileTabGridCloseIncognitoTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>User in the iOS tab grid closed an incognito tab.</description>
</action>
<action name="MobileTabGridCloseRegularTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>User in the iOS tab grid closed a regular tab.</description>
</action>
<action name="MobileTabGridCreateIncognitoTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid created a new incognito tab using the new tab
button.
</description>
</action>
<action name="MobileTabGridCreateIncognitoTabKeyboard">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid created a new incognito tab using the keyboard
shortcut.
</description>
</action>
<action name="MobileTabGridCreateRegularTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid created a new regular tab using the new tab button.
</description>
</action>
<action name="MobileTabGridCreateRegularTabKeyboard">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid created a new regular tab using the keyboard
shortcut.
</description>
</action>
<action name="MobileTabGridDone">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>User tapped the 'Done' button in the iOS tab grid.</description>
</action>
<action name="MobileTabGridEndedWithoutReordering"> <action name="MobileTabGridEndedWithoutReordering">
<owner>edchin@chromium.org</owner> <owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner> <owner>marq@chromium.org</owner>
...@@ -12394,6 +12455,34 @@ should be able to be added at any place in this file. ...@@ -12394,6 +12455,34 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="MobileTabGridEntered">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>User entered the iOS tab grid (from anywhere).</description>
</action>
<action name="MobileTabGridExited">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>User exited the iOS tab grid (by any means).</description>
</action>
<action name="MobileTabGridOpenIncognitoTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid opened an incognito tab by tapping on it.
</description>
</action>
<action name="MobileTabGridOpenRegularTab">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User in the iOS tab grid opened a regular tab by tapping on it.
</description>
</action>
<action name="MobileTabGridReordered"> <action name="MobileTabGridReordered">
<owner>edchin@chromium.org</owner> <owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner> <owner>marq@chromium.org</owner>
...@@ -12403,6 +12492,32 @@ should be able to be added at any place in this file. ...@@ -12403,6 +12492,32 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="MobileTabGridSelectIncognitoPanel">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User selected the iOS Tab Grid incognito panel by tapping the page control.
</description>
</action>
<action name="MobileTabGridSelectRegularPanel">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User selected the iOS Tab Grid regular tabs panel by tapping the page
control.
</description>
</action>
<action name="MobileTabGridSelectRemotePanel">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
<description>
User selected the iOS Tab Grid remote tabs panel by tapping the page
control.
</description>
</action>
<action name="MobileTabGridUndoCloseAllRegularTabs"> <action name="MobileTabGridUndoCloseAllRegularTabs">
<owner>edchin@chromium.org</owner> <owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner> <owner>marq@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment