diff options
author | fgorski <fgorski@chromium.org> | 2015-11-13 15:40:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 23:41:08 +0000 |
commit | e41ade8dcfdc692b9e5ad98419f4b19571452928 (patch) | |
tree | cbaafef2ace7dd6e5ad2a75d3a4331c00172cccd | |
parent | 021507d05b07b22696a5c7c172a2b14797b12680 (diff) | |
download | chromium_src-e41ade8dcfdc692b9e5ad98419f4b19571452928.zip chromium_src-e41ade8dcfdc692b9e5ad98419f4b19571452928.tar.gz chromium_src-e41ade8dcfdc692b9e5ad98419f4b19571452928.tar.bz2 |
[Offline pages] Adding UMA to count bookmarks/offline pages and snackbar Edit action
Adding counts of bookmarks and offline pages to compare consumption
of the two features.
Recording a user action when snackbar with Edit button is shown after
a bookmark/saved page is created.
BUG=491352
Review URL: https://codereview.chromium.org/1438123009
Cr-Commit-Position: refs/heads/master@{#359688}
4 files changed, 40 insertions, 1 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkItemsAdapter.java index 957fe77..183016b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkItemsAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkItemsAdapter.java @@ -12,6 +12,7 @@ import android.view.View; import android.view.ViewGroup; import org.chromium.base.annotations.SuppressFBWarnings; +import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.bookmark.BookmarksBridge.BookmarkItem; import org.chromium.chrome.browser.bookmark.BookmarksBridge.BookmarkModelObserver; @@ -326,7 +327,11 @@ class EnhancedBookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.Vie @Override public void onAllBookmarksStateSet() { - setBookmarks(null, mDelegate.getModel().getAllBookmarkIDsOrderedByCreationDate()); + List<BookmarkId> bookmarkIds = + mDelegate.getModel().getAllBookmarkIDsOrderedByCreationDate(); + RecordHistogram.recordCountHistogram("EnhancedBookmarks.AllBookmarksCount", + bookmarkIds.size()); + setBookmarks(null, bookmarkIds); } @Override @@ -338,6 +343,8 @@ class EnhancedBookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.Vie @Override public void onFilterStateSet(EnhancedBookmarkFilter filter) { assert filter == EnhancedBookmarkFilter.OFFLINE_PAGES; + List<BookmarkId> bookmarkIds = mDelegate.getModel().getBookmarkIDsByFilter(filter); + RecordHistogram.recordCountHistogram("OfflinePages.OfflinePageCount", bookmarkIds.size()); setBookmarks(null, mDelegate.getModel().getBookmarkIDsByFilter(filter)); mDelegate.getModel().getOfflinePageBridge().checkOfflinePageMetadata(); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkUtils.java index 55c209f..938d838 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkUtils.java @@ -191,12 +191,14 @@ public class EnhancedBookmarkUtils { @Override public void onDismissNoAction(Object actionData) { + RecordUserAction.record("EnhancedBookmarks.EditAfterCreateButtonNotClicked"); // This method will be called only if the snackbar is dismissed by timeout. bookmarkModel.destroy(); } @Override public void onAction(Object actionData) { + RecordUserAction.record("EnhancedBookmarks.EditAfterCreateButtonClicked"); // Show edit activity with the name of parent folder highlighted. startEditActivity(activity, bookmarkId, null); bookmarkModel.destroy(); diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 979dd73..c4f027d 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml @@ -3004,6 +3004,24 @@ should be able to be added at any place in this file. <description>Please enter the description of this user action.</description> </action> +<action name="EnhancedBookmarks.EditAfterCreateButtonClicked"> + <owner>kkimlabs@chromium.org</owner> + <owner>ianwen@chromium.org</owner> + <owner>fgorski@chromium.org</owner> + <description> + User clicked the Edit button on a snackbar after a bookmark was created. + </description> +</action> + +<action name="EnhancedBookmarks.EditAfterCreateButtonNotClicked"> + <owner>kkimlabs@chromium.org</owner> + <owner>ianwen@chromium.org</owner> + <owner>fgorski@chromium.org</owner> + <description> + User ignored the Edit button on a snackbar after a bookmark was created. + </description> +</action> + <action name="EnterFullScreenWithWrenchMenu"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description> diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 5b638f9..4e48164 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -9428,6 +9428,12 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. </summary> </histogram> +<histogram name="EnhancedBookmarks.AllBookmarksCount"> + <owner>ianwen@chromium.org</owner> + <owner>kkimlabs@chromium.org</owner> + <summary>Number of bookmarks the user has. Android only.</summary> +</histogram> + <histogram name="EnhancedBookmarks.SyncExperimentState" enum="BookmarksExperimentState"> <obsolete> @@ -29866,6 +29872,12 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. </summary> </histogram> +<histogram name="OfflinePages.OfflinePageCount"> + <owner>fgorski@chromium.org</owner> + <owner>jianli@chromium.org</owner> + <summary>Number of offline pages the user has. Android only.</summary> +</histogram> + <histogram name="OfflinePages.PageLifetime" units="minutes"> <owner>jianli@chromium.org</owner> <summary> |