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) {
[self.delegate gridViewController:self
didCloseItemWithID:cell.itemIdentifier];
// Record when a tab is closed via the X.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(base::UserMetricsAction("MobileStackViewCloseTab"));
base::RecordAction(
base::UserMetricsAction("MobileTabGridCloseControlTapped"));
}
#pragma mark - GridConsumer
......
......@@ -285,8 +285,7 @@
completion:nil];
}
// Record when the tab switcher is presented.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(base::UserMetricsAction("MobileTabSwitcherPresented"));
base::RecordAction(base::UserMetricsAction("MobileTabGridEntered"));
}
- (void)showTabViewController:(UIViewController*)viewController
......@@ -294,8 +293,7 @@
DCHECK(viewController);
// Record when the tab switcher is dismissed.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(base::UserMetricsAction("MobileTabSwitcherDismissed"));
base::RecordAction(base::UserMetricsAction("MobileTabGridExited"));
// If another BVC is already being presented, swap this one into the
// container.
......
......@@ -910,25 +910,19 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// There are duplicate metrics below that correspond to the previous
// separate implementations for iPhone and iPad. Having both allow for
// comparisons to the previous implementations.
// TODO(crbug.com/856965) : Consolidate and rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileStackViewIncognitoMode"));
base::RecordAction(base::UserMetricsAction(
"MobileTabSwitcherHeaderViewSelectIncognitoPanel"));
base::UserMetricsAction("MobileTabGridSelectIncognitoPanel"));
break;
case TabGridPageRegularTabs:
// There are duplicate metrics below that correspond to the previous
// separate implementations for iPhone and iPad. Having both allow for
// comparisons to the previous implementations.
// TODO(crbug.com/856965) : Consolidate and rename metrics.
base::RecordAction(base::UserMetricsAction("MobileStackViewNormalMode"));
base::RecordAction(base::UserMetricsAction(
"MobileTabSwitcherHeaderViewSelectNonIncognitoPanel"));
base::RecordAction(
base::UserMetricsAction("MobileTabGridSelectRegularPanel"));
break;
case TabGridPageRemoteTabs:
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(base::UserMetricsAction(
"MobileTabSwitcherHeaderViewSelectDistantSessionPanel"));
base::RecordAction(
base::UserMetricsAction("MobileTabGridSelectRemotePanel"));
break;
}
switch (self.pageChangeInteraction) {
......@@ -960,18 +954,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
case TabGridPageIncognitoTabs:
[self.incognitoTabsViewController prepareForDismissal];
[self.incognitoTabsDelegate addNewItem];
// Record when new incognito tab is created.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCreateIncognitoTab"));
break;
case TabGridPageRegularTabs:
[self.regularTabsViewController prepareForDismissal];
[self.regularTabsDelegate addNewItem];
// Record when new regular tab is created.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCreateNonIncognitoTab"));
break;
case TabGridPageRemoteTabs:
NOTREACHED() << "It is invalid to have an active tab in remote tabs.";
......@@ -985,19 +971,30 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// Creates and shows a new regular tab.
- (void)openNewRegularTabForKeyboardCommand {
[self openNewTabInPage:TabGridPageRegularTabs focusOmnibox:YES];
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateRegularTabKeyboard"));
}
// Creates and shows a new incognito tab.
- (void)openNewIncognitoTabForKeyboardCommand {
[self openNewTabInPage:TabGridPageIncognitoTabs focusOmnibox:YES];
base::RecordAction(
base::UserMetricsAction("MobileTabGridCreateIncognitoTabKeyboard"));
}
// Creates and shows a new tab in the current page.
- (void)openNewTabInCurrentPageForKeyboardCommand {
// Tabs cannot be opened with ⌘-t from the remote tabs page.
if (self.currentPage == TabGridPageRemoteTabs)
return;
[self openNewTabInPage:self.currentPage focusOmnibox:YES];
switch (self.currentPage) {
case TabGridPageIncognitoTabs:
[self openNewIncognitoTabForKeyboardCommand];
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.
......@@ -1046,15 +1043,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
if (gridViewController == self.regularTabsViewController) {
[self.regularTabsDelegate selectItemWithID:itemID];
// Record when a regular tab is opened.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherOpenNonIncognitoTab"));
base::RecordAction(base::UserMetricsAction("MobileTabGridOpenRegularTab"));
} else if (gridViewController == self.incognitoTabsViewController) {
[self.incognitoTabsDelegate selectItemWithID:itemID];
// Record when an incognito tab is opened.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab"));
base::UserMetricsAction("MobileTabGridOpenIncognitoTab"));
}
self.activePage = self.currentPage;
[self.tabPresentationDelegate showActiveTabInPage:self.currentPage
......@@ -1067,15 +1061,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
if (gridViewController == self.regularTabsViewController) {
[self.regularTabsDelegate closeItemWithID:itemID];
// Record when a regular tab is closed.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab"));
base::RecordAction(base::UserMetricsAction("MobileTabGridCloseRegularTab"));
} else if (gridViewController == self.incognitoTabsViewController) {
[self.incognitoTabsDelegate closeItemWithID:itemID];
// Record when an incognito tab is closed.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab"));
base::UserMetricsAction("MobileTabGridCloseIncognitoTab"));
}
}
......@@ -1144,9 +1135,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
focusOmnibox:NO];
// Record when users exit the tab grid to return to the current foreground
// tab.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(
base::UserMetricsAction("MobileTabReturnedToCurrentTab"));
base::RecordAction(base::UserMetricsAction("MobileTabGridDone"));
}
}
......@@ -1180,9 +1169,20 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
- (void)newTabButtonTapped:(id)sender {
[self openNewTabInPage:self.currentPage focusOmnibox:NO];
// Record only when a new tab is created through the + button.
// TODO(crbug.com/856965) : Rename metrics.
base::RecordAction(base::UserMetricsAction("MobileToolbarStackViewNewTab"));
// Record metrics for button taps
switch (self.currentPage) {
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 {
......
......@@ -12385,6 +12385,67 @@ should be able to be added at any place in this file.
</description>
</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">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
......@@ -12394,6 +12455,34 @@ should be able to be added at any place in this file.
</description>
</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">
<owner>edchin@chromium.org</owner>
<owner>marq@chromium.org</owner>
......@@ -12403,6 +12492,32 @@ should be able to be added at any place in this file.
</description>
</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">
<owner>edchin@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