Commit 5b7c3d5c authored by gogerald's avatar gogerald Committed by Commit Bot

[StartSurface] Add more user actions

Bug: 982018
Change-Id: Idb97cf0d324b4addc23a8ced0c75facb4096c126
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1757508
Commit-Queue: Ganggui Tang <gogerald@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Auto-Submit: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689190}
parent 9291cc8c
...@@ -15,6 +15,7 @@ import android.support.annotation.Nullable; ...@@ -15,6 +15,7 @@ import android.support.annotation.Nullable;
import android.view.View; import android.view.View;
import org.chromium.base.ObserverList; import org.chromium.base.ObserverList;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.browser.feed.FeedSurfaceCoordinator; import org.chromium.chrome.browser.feed.FeedSurfaceCoordinator;
import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver;
import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModel;
...@@ -78,6 +79,7 @@ class StartSurfaceMediator ...@@ -78,6 +79,7 @@ class StartSurfaceMediator
@Override @Override
public void onHomeButtonClicked() { public void onHomeButtonClicked() {
setExploreSurfaceVisibility(false); setExploreSurfaceVisibility(false);
RecordUserAction.record("StartSurface.TwoPanes.BottomBar.TapHome");
} }
@Override @Override
...@@ -85,6 +87,8 @@ class StartSurfaceMediator ...@@ -85,6 +87,8 @@ class StartSurfaceMediator
// TODO(crbug.com/982018): Hide the Tab switcher toolbar when showing // TODO(crbug.com/982018): Hide the Tab switcher toolbar when showing
// explore surface. // explore surface.
setExploreSurfaceVisibility(true); setExploreSurfaceVisibility(true);
RecordUserAction.record(
"StartSurface.TwoPanes.BottomBar.TapExploreSurface");
} }
}); });
...@@ -133,7 +137,19 @@ class StartSurfaceMediator ...@@ -133,7 +137,19 @@ class StartSurfaceMediator
public void showOverview(boolean animate) { public void showOverview(boolean animate) {
// TODO(crbug.com/982018): Animate the bottom bar together with the Tab Grid view. // TODO(crbug.com/982018): Animate the bottom bar together with the Tab Grid view.
if (mPropertyModel != null) { if (mPropertyModel != null) {
if (mOnlyShowExploreSurface) mPropertyModel.set(IS_EXPLORE_SURFACE_VISIBLE, true); // There are only two modes (single pane, when mOnlyShowExploreSurface == true, and two
// panes) available when mPropertyModel != null.
if (mOnlyShowExploreSurface) {
RecordUserAction.record("StartSurface.SinglePane");
mPropertyModel.set(IS_EXPLORE_SURFACE_VISIBLE, true);
} else {
RecordUserAction.record("StartSurface.TwoPanes");
String defaultOnUserActionString = mPropertyModel.get(IS_EXPLORE_SURFACE_VISIBLE)
? "ExploreSurface"
: "HomeSurface";
RecordUserAction.record(
"StartSurface.TwoPanes.DefaultOn" + defaultOnUserActionString);
}
// Make sure FeedSurfaceCoordinator is built before the explore surface is showing by // Make sure FeedSurfaceCoordinator is built before the explore surface is showing by
// default. // default.
...@@ -215,6 +231,7 @@ class StartSurfaceMediator ...@@ -215,6 +231,7 @@ class StartSurfaceMediator
setExploreSurfaceVisibility(false); setExploreSurfaceVisibility(false);
mSecondaryTasksSurfaceController.showOverview(false); mSecondaryTasksSurfaceController.showOverview(false);
RecordUserAction.record("StartSurface.SinglePane.MoreTabs");
} }
/** This interface builds the feed surface coordinator when showing if needed. */ /** This interface builds the feed surface coordinator when showing if needed. */
......
...@@ -20334,6 +20334,62 @@ should be able to be added at any place in this file. ...@@ -20334,6 +20334,62 @@ should be able to be added at any place in this file.
<description>Please enter the description of the metric.</description> <description>Please enter the description of the metric.</description>
</action> </action>
<action name="StartSurface.SinglePane">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the single pane start surface is shown (the user taps the
tab switcher button or on chrome start).
</description>
</action>
<action name="StartSurface.SinglePane.MoreTabs">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the user taps the more tabs button on the single pane
start surface.
</description>
</action>
<action name="StartSurface.TwoPanes">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the two panes start surface is shown (the user taps the
tab switcher button or on chrome start).
</description>
</action>
<action name="StartSurface.TwoPanes.BottomBar.TapExploreSurface">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the user taps the explore button on the two panes start
surface.
</description>
</action>
<action name="StartSurface.TwoPanes.BottomBar.TapHome">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the user taps the home button on the two panes start
surface
</description>
</action>
<action name="StartSurface.TwoPanes.DefaultOnExploreSurface">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the two panes start surface is shown with explore surface
visible by default.
</description>
</action>
<action name="StartSurface.TwoPanes.DefaultOnHomeSurface">
<owner>gogerald@chromium.org</owner>
<description>
Metric record when the two panes start surface is shown with home surface
visible by default.
</description>
</action>
<action name="StartupTick" not_user_triggered="true"> <action name="StartupTick" not_user_triggered="true">
<obsolete>Deprecated in favor of AboutFlags.Seen histogram.</obsolete> <obsolete>Deprecated in favor of AboutFlags.Seen histogram.</obsolete>
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</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