Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: chrome/browser/ui/webui/browsing_history_handler.cc

Issue 1968983002: Add histograms for notices about other forms of browsing history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/browsing_history_handler.cc
diff --git a/chrome/browser/ui/webui/browsing_history_handler.cc b/chrome/browser/ui/webui/browsing_history_handler.cc
index 5695454618d919f5f7743f136fa37cd4b0b29ca3..8a8b870e1b21afe1cfcfb09606801d6a28339e3a 100644
--- a/chrome/browser/ui/webui/browsing_history_handler.cc
+++ b/chrome/browser/ui/webui/browsing_history_handler.cc
@@ -157,6 +157,12 @@ void GetDeviceNameAndType(const ProfileSyncService* sync_service,
*type = kDeviceTypeLaptop;
}
+void RecordMetricsForNoticeAboutOtherFormsOfBrowsingHistory(bool shown) {
+ UMA_HISTOGRAM_BOOLEAN(
+ "History.ShownHeaderAboutOtherFormsOfBrowsingHistory",
+ shown);
+}
+
} // namespace
BrowsingHistoryHandler::HistoryEntry::HistoryEntry(
@@ -429,6 +435,9 @@ void BrowsingHistoryHandler::QueryHistory(
base::Bind(
&BrowsingHistoryHandler::OtherFormsOfBrowsingHistoryQueryComplete,
weak_factory_.GetWeakPtr()));
+ } else {
+ // The notice could not have been shown, because there is no web history.
+ RecordMetricsForNoticeAboutOtherFormsOfBrowsingHistory(false);
}
}
@@ -849,6 +858,10 @@ void BrowsingHistoryHandler::WebHistoryQueryComplete(
void BrowsingHistoryHandler::OtherFormsOfBrowsingHistoryQueryComplete(
bool found_other_forms_of_browsing_history) {
has_other_forms_of_browsing_history_ = found_other_forms_of_browsing_history;
+
+ RecordMetricsForNoticeAboutOtherFormsOfBrowsingHistory(
+ has_other_forms_of_browsing_history_);
+
web_ui()->CallJavascriptFunction(
"showNotification",
base::FundamentalValue(has_synced_results_),

Powered by Google App Engine
This is Rietveld 408576698