Commit 15f44d67 authored by tby's avatar tby Committed by Chromium LUCI CQ

Remove obsolete launcher histograms

These are largely replaced by the app list notifier metrics.

Bug: 1165218,1165219
Change-Id: I35652f5a674d9e8b5efdead52a48d65e7c0cf58b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627196Reviewed-by: default avatarRachel Wong <wrong@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843819}
parent 0c68e670
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/events/event.h" #include "ui/events/event.h"
...@@ -41,8 +40,6 @@ namespace { ...@@ -41,8 +40,6 @@ namespace {
constexpr base::TimeDelta kImpressionThreshold = constexpr base::TimeDelta kImpressionThreshold =
base::TimeDelta::FromSeconds(3); base::TimeDelta::FromSeconds(3);
constexpr base::TimeDelta kZeroStateImpressionThreshold =
base::TimeDelta::FromSeconds(1);
SearchResultIdWithPositionIndices GetSearchResultsForLogging( SearchResultIdWithPositionIndices GetSearchResultsForLogging(
std::vector<SearchResultView*> search_result_views) { std::vector<SearchResultView*> search_result_views) {
...@@ -56,19 +53,6 @@ SearchResultIdWithPositionIndices GetSearchResultsForLogging( ...@@ -56,19 +53,6 @@ SearchResultIdWithPositionIndices GetSearchResultsForLogging(
return results; return results;
} }
bool IsZeroStateFile(const SearchResult& result) {
return result.result_type() == AppListSearchResultType::kZeroStateFile;
}
bool IsDriveQuickAccess(const SearchResult& result) {
return result.result_type() == AppListSearchResultType::kDriveQuickAccess;
}
void LogFileImpressions(SearchResultType result_type) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppList.ZeroStateResultsList.FileImpressions",
result_type, SEARCH_RESULT_TYPE_BOUNDARY);
}
} // namespace } // namespace
SearchResultListView::SearchResultListView(AppListMainView* main_view, SearchResultListView::SearchResultListView(AppListMainView* main_view,
...@@ -120,21 +104,9 @@ int SearchResultListView::DoUpdate() { ...@@ -120,21 +104,9 @@ int SearchResultListView::DoUpdate() {
std::vector<SearchResult*> display_results = GetSearchResults(); std::vector<SearchResult*> display_results = GetSearchResults();
// TODO(crbug.com/1076270): The logic for zero state and Drive quick access
// files below exists only for metrics, and can be folded into the
// AppListNotifier and done in chrome.
bool found_zero_state_file = false;
bool found_drive_quick_access = false;
for (size_t i = 0; i < search_result_views_.size(); ++i) { for (size_t i = 0; i < search_result_views_.size(); ++i) {
SearchResultView* result_view = GetResultViewAt(i); SearchResultView* result_view = GetResultViewAt(i);
if (i < display_results.size()) { if (i < display_results.size()) {
if (IsZeroStateFile(*display_results[i])) {
found_zero_state_file = true;
} else if (IsDriveQuickAccess(*display_results[i])) {
found_drive_quick_access = true;
}
result_view->SetResult(display_results[i]); result_view->SetResult(display_results[i]);
result_view->SetVisible(true); result_view->SetVisible(true);
} else { } else {
...@@ -162,26 +134,6 @@ int SearchResultListView::DoUpdate() { ...@@ -162,26 +134,6 @@ int SearchResultListView::DoUpdate() {
impression_timer_.Start(FROM_HERE, kImpressionThreshold, this, impression_timer_.Start(FROM_HERE, kImpressionThreshold, this,
&SearchResultListView::LogImpressions); &SearchResultListView::LogImpressions);
// Log impressions for local zero state files.
if (!found_zero_state_file)
zero_state_file_impression_timer_.Stop();
if (found_zero_state_file && !previous_found_zero_state_file_) {
zero_state_file_impression_timer_.Start(
FROM_HERE, kZeroStateImpressionThreshold,
base::BindOnce(&LogFileImpressions, ZERO_STATE_FILE));
}
previous_found_zero_state_file_ = found_zero_state_file;
// Log impressions for Drive Quick Access files.
if (!found_drive_quick_access)
drive_quick_access_impression_timer_.Stop();
if (found_drive_quick_access && !previous_found_drive_quick_access_) {
drive_quick_access_impression_timer_.Start(
FROM_HERE, kZeroStateImpressionThreshold,
base::BindOnce(&LogFileImpressions, DRIVE_QUICK_ACCESS));
}
previous_found_drive_quick_access_ = found_drive_quick_access;
set_container_score( set_container_score(
display_results.empty() display_results.empty()
? -1.0 ? -1.0
...@@ -264,11 +216,6 @@ void SearchResultListView::VisibilityChanged(View* starting_from, ...@@ -264,11 +216,6 @@ void SearchResultListView::VisibilityChanged(View* starting_from,
// We only do this work when is_visible is false. // We only do this work when is_visible is false.
if (is_visible) if (is_visible)
return; return;
zero_state_file_impression_timer_.Stop();
drive_quick_access_impression_timer_.Stop();
previous_found_zero_state_file_ = false;
previous_found_drive_quick_access_ = false;
} }
std::vector<SearchResult*> SearchResultListView::GetAssistantResults() { std::vector<SearchResult*> SearchResultListView::GetAssistantResults() {
......
...@@ -84,10 +84,6 @@ class APP_LIST_EXPORT SearchResultListView : public SearchResultContainerView { ...@@ -84,10 +84,6 @@ class APP_LIST_EXPORT SearchResultListView : public SearchResultContainerView {
// Used for logging impressions shown to users. // Used for logging impressions shown to users.
base::OneShotTimer impression_timer_; base::OneShotTimer impression_timer_;
base::OneShotTimer zero_state_file_impression_timer_;
base::OneShotTimer drive_quick_access_impression_timer_;
bool previous_found_zero_state_file_ = false;
bool previous_found_drive_quick_access_ = false;
DISALLOW_COPY_AND_ASSIGN(SearchResultListView); DISALLOW_COPY_AND_ASSIGN(SearchResultListView);
}; };
......
...@@ -60,10 +60,6 @@ ZeroStateFileProvider::ZeroStateFileProvider(Profile* profile) ...@@ -60,10 +60,6 @@ ZeroStateFileProvider::ZeroStateFileProvider(Profile* profile)
auto* notifier = auto* notifier =
file_manager::file_tasks::FileTasksNotifier::GetForProfile(profile_); file_manager::file_tasks::FileTasksNotifier::GetForProfile(profile_);
UMA_HISTOGRAM_BOOLEAN(
"Apps.AppList.ZeroStateFileProvider.NotifierCreationSuccess",
notifier != nullptr);
if (notifier) { if (notifier) {
file_tasks_observer_.Add(notifier); file_tasks_observer_.Add(notifier);
......
...@@ -525,6 +525,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -525,6 +525,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateFileProvider.NotifierCreationSuccess" <histogram name="Apps.AppList.ZeroStateFileProvider.NotifierCreationSuccess"
enum="BooleanSuccess" expires_after="2021-02-07"> enum="BooleanSuccess" expires_after="2021-02-07">
<obsolete>
Removed January 2021.
</obsolete>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>edimitriadis@chromium.org</owner> <owner>edimitriadis@chromium.org</owner>
<summary> <summary>
...@@ -613,6 +616,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -613,6 +616,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResultsList.FileImpressions" <histogram name="Apps.AppList.ZeroStateResultsList.FileImpressions"
enum="AppListSearchResult" expires_after="2021-02-07"> enum="AppListSearchResult" expires_after="2021-02-07">
<obsolete>
Removed January 2021.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<summary> <summary>
......
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