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

Side by Side Diff: chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc

Issue 2800773003: Settings reset prompt: add more UI metrics. (Closed)
Patch Set: Remove interaction_done_ Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_controller.h" 5 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 UMA_HISTOGRAM_LONG_TIMES_100("SettingsResetPrompt.TimeUntilAccepted", 163 UMA_HISTOGRAM_LONG_TIMES_100("SettingsResetPrompt.TimeUntilAccepted",
164 base::Time::Now() - time_dialog_shown_); 164 base::Time::Now() - time_dialog_shown_);
165 UMA_HISTOGRAM_BOOLEAN("SettingsResetPrompt.PromptAccepted", true); 165 UMA_HISTOGRAM_BOOLEAN("SettingsResetPrompt.PromptAccepted", true);
166 model_->PerformReset( 166 model_->PerformReset(
167 base::Bind(&SettingsResetPromptController::OnInteractionDone, 167 base::Bind(&SettingsResetPromptController::OnInteractionDone,
168 base::Unretained(this))); 168 base::Unretained(this)));
169 } 169 }
170 170
171 void SettingsResetPromptController::Cancel() { 171 void SettingsResetPromptController::Cancel() {
172 DCHECK(!time_dialog_shown_.is_null()); 172 DCHECK(!time_dialog_shown_.is_null());
173 base::RecordAction(base::UserMetricsAction("SettingsResetPrompt_Declined")); 173 base::RecordAction(base::UserMetricsAction("SettingsResetPrompt_Canceled"));
174 UMA_HISTOGRAM_LONG_TIMES_100("SettingsResetPrompt.TimeUntilDeclined", 174 UMA_HISTOGRAM_LONG_TIMES_100("SettingsResetPrompt.TimeUntilCanceled",
175 base::Time::Now() - time_dialog_shown_); 175 base::Time::Now() - time_dialog_shown_);
176 UMA_HISTOGRAM_BOOLEAN("SettingsResetPrompt.PromptAccepted", false); 176 UMA_HISTOGRAM_BOOLEAN("SettingsResetPrompt.PromptAccepted", false);
177 OnInteractionDone(); 177 OnInteractionDone();
178 }
179
180 void SettingsResetPromptController::Close() {
181 DCHECK(!time_dialog_shown_.is_null());
182 base::RecordAction(base::UserMetricsAction("SettingsResetPrompt_Dismissed"));
183 UMA_HISTOGRAM_LONG_TIMES_100("SettingsResetPrompt.TimeUntilDismissed",
184 base::Time::Now() - time_dialog_shown_);
185 UMA_HISTOGRAM_BOOLEAN("SettingsResetPrompt.PromptAccepted", false);
186 OnInteractionDone();
178 } 187 }
179 188
180 void SettingsResetPromptController::InitMainText() { 189 void SettingsResetPromptController::InitMainText() {
181 DCHECK(main_text_.empty()); 190 DCHECK(main_text_.empty());
182 191
183 // Get the URL string to be displayed in the dialog message. 192 // Get the URL string to be displayed in the dialog message.
184 base::string16 url_string; 193 base::string16 url_string;
185 if (ResetSearchEnabled(*model_)) { 194 if (ResetSearchEnabled(*model_)) {
186 url_string = FormatUrlForDisplay(model_->default_search()); 195 url_string = FormatUrlForDisplay(model_->default_search());
187 } else if (ResetStartupUrlsEnabled(*model_)) { 196 } else if (ResetStartupUrlsEnabled(*model_)) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (!config) 250 if (!config)
242 return; 251 return;
243 252
244 base::TimeDelta delay = config->delay_before_prompt(); 253 base::TimeDelta delay = config->delay_before_prompt();
245 content::BrowserThread::PostDelayedTask( 254 content::BrowserThread::PostDelayedTask(
246 content::BrowserThread::UI, FROM_HERE, 255 content::BrowserThread::UI, FROM_HERE,
247 base::Bind(MaybeShowSettingsResetPrompt, base::Passed(&config)), delay); 256 base::Bind(MaybeShowSettingsResetPrompt, base::Passed(&config)), delay);
248 } 257 }
249 258
250 } // namespace safe_browsing 259 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698