Commit 50305e58 authored by sczs's avatar sczs Committed by Commit bot

Adds the following user action metrics:

HistoryPage_EntryLinkClick
HistoryPage_InitClearBrowsingData
HistoryPage_RemoveSelected
HistoryPage_Search
HistoryPage_SearchResultClick

BUG=676121

Review-Url: https://codereview.chromium.org/2592843002
Cr-Commit-Position: refs/heads/master@{#441968}
parent e1e1e253
......@@ -12,6 +12,8 @@
#include "base/mac/foundation_util.h"
#import "base/mac/objc_property_releaser.h"
#include "base/mac/scoped_nsobject.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/browsing_data/core/history_notice_utils.h"
......@@ -481,6 +483,12 @@ const CGFloat kSeparatorInset = 10;
HistoryEntryItem* item = base::mac::ObjCCastStrict<HistoryEntryItem>(
[self.collectionViewModel itemAtIndexPath:indexPath]);
[self openURL:item.URL];
if (self.isSearching) {
base::RecordAction(
base::UserMetricsAction("HistoryPage_SearchResultClick"));
} else {
base::RecordAction(base::UserMetricsAction("HistoryPage_EntryLinkClick"));
}
}
}
......
......@@ -8,6 +8,8 @@
#include "base/ios/ios_util.h"
#include "base/ios/weak_nsobject.h"
#include "base/mac/scoped_nsobject.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/history/clear_browsing_bar.h"
#import "ios/chrome/browser/ui/history/history_collection_view_controller.h"
......@@ -307,6 +309,8 @@ CGFloat kShadowOpacity = 0.2f;
- (void)openPrivacySettings {
[self exitSearchMode];
base::RecordAction(
base::UserMetricsAction("HistoryPage_InitClearBrowsingData"));
ShowClearBrowsingData();
}
......@@ -332,6 +336,7 @@ CGFloat kShadowOpacity = 0.2f;
- (void)deleteSelectedItems {
[_historyCollectionController deleteSelectedItemsFromHistory];
base::RecordAction(base::UserMetricsAction("HistoryPage_RemoveSelected"));
[self exitEditingMode];
}
- (void)enterSearchMode {
......@@ -345,6 +350,7 @@ CGFloat kShadowOpacity = 0.2f;
[self.view addSubview:searchBarView];
_historyCollectionController.get().searching = YES;
[_searchViewController didMoveToParentViewController:self];
base::RecordAction(base::UserMetricsAction("HistoryPage_Search"));
// Constraints to make search bar cover header.
[searchBarView setTranslatesAutoresizingMaskIntoConstraints:NO];
......
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