Skip to content

Commit

Permalink
[Android] Add UMA for pull-to-refresh activation
Browse files Browse the repository at this point in the history
Add a baseline metric for the number of page reloads triggered by the
new pull-to-refresh gesture, allowing comparison with other avenues
for page reload (e.g., from toolbar reload icon).

BUG=442505

Review URL: https://codereview.chromium.org/803343002

Cr-Commit-Position: refs/heads/master@{#308477}
  • Loading branch information
jdduke authored and Commit bot committed Dec 16, 2014
1 parent 0cdd39f commit 07e2788
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/browser/android/overscroll_controller_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/input/did_overscroll_params.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/android/resources/resource_manager.h"
Expand Down Expand Up @@ -277,6 +278,7 @@ void OverscrollControllerAndroid::TriggerRefresh() {
return;

triggered_refresh_active_ = true;
RecordAction(base::UserMetricsAction("MobilePullGestureReload"));
web_contents()->GetController().Reload(true);
}

Expand Down
9 changes: 9 additions & 0 deletions tools/metrics/actions/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7575,6 +7575,15 @@ should be able to be added at any place in this file.
<description>User closes the tab while preview page is loaded.</description>
</action>

<action name="MobilePullGestureReload">
<owner>jdduke@chromium.org</owner>
<description>
Emitted on Android when a pull-to-refresh touch gesture initiates a page
reload. This fires only after the triggering touch is released while the
refresh effect has been pulled beyond the activation threshold.
</description>
</action>

<action name="MobileReceivedExternalIntent">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
Expand Down
1 change: 1 addition & 0 deletions tools/metrics/actions/extract_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def AddAndroidActions(actions):
actions.add('MobilePageLoaded')
actions.add('MobilePageLoadedDesktopUserAgent')
actions.add('MobilePageLoadedWithKeyboard')
actions.add('MobilePullGestureReload')
actions.add('MobileReceivedExternalIntent')
actions.add('MobileRendererCrashed')
actions.add('MobileShortcutAllBookmarks')
Expand Down

0 comments on commit 07e2788

Please sign in to comment.