OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/auto_login_infobar_delegate.h" | 5 #include "chrome/browser/ui/auto_login_infobar_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // SigninManager isn't guaranteed to exist for |profile_|. | 172 // SigninManager isn't guaranteed to exist for |profile_|. |
173 SigninManagerBase* signin_manager = | 173 SigninManagerBase* signin_manager = |
174 SigninManagerFactory::GetInstance()->GetForProfile(profile_); | 174 SigninManagerFactory::GetInstance()->GetForProfile(profile_); |
175 if (signin_manager) | 175 if (signin_manager) |
176 signin_manager->RemoveObserver(this); | 176 signin_manager->RemoveObserver(this); |
177 | 177 |
178 if (!button_pressed_) | 178 if (!button_pressed_) |
179 RecordHistogramAction(IGNORED); | 179 RecordHistogramAction(IGNORED); |
180 } | 180 } |
181 | 181 |
| 182 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { |
| 183 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, |
| 184 HISTOGRAM_BOUNDING_VALUE); |
| 185 } |
| 186 |
182 void AutoLoginInfoBarDelegate::InfoBarDismissed() { | 187 void AutoLoginInfoBarDelegate::InfoBarDismissed() { |
183 RecordHistogramAction(DISMISSED); | 188 RecordHistogramAction(DISMISSED); |
184 button_pressed_ = true; | 189 button_pressed_ = true; |
185 } | 190 } |
186 | 191 |
187 int AutoLoginInfoBarDelegate::GetIconID() const { | 192 int AutoLoginInfoBarDelegate::GetIconID() const { |
188 return IDR_INFOBAR_AUTOLOGIN; | 193 return IDR_INFOBAR_AUTOLOGIN; |
189 } | 194 } |
190 | 195 |
191 infobars::InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() | 196 infobars::InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 web_contents->GetBrowserContext())->GetPrefs(); | 231 web_contents->GetBrowserContext())->GetPrefs(); |
227 pref_service->SetBoolean(prefs::kAutologinEnabled, false); | 232 pref_service->SetBoolean(prefs::kAutologinEnabled, false); |
228 RecordHistogramAction(REJECTED); | 233 RecordHistogramAction(REJECTED); |
229 button_pressed_ = true; | 234 button_pressed_ = true; |
230 return true; | 235 return true; |
231 } | 236 } |
232 | 237 |
233 void AutoLoginInfoBarDelegate::GoogleSignedOut(const std::string& username) { | 238 void AutoLoginInfoBarDelegate::GoogleSignedOut(const std::string& username) { |
234 infobar()->RemoveSelf(); | 239 infobar()->RemoveSelf(); |
235 } | 240 } |
236 | |
237 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { | |
238 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, | |
239 HISTOGRAM_BOUNDING_VALUE); | |
240 } | |
OLD | NEW |