| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/password_generation_util.h" |
| 6 |
| 7 #include "base/metrics/histogram.h" |
| 8 |
| 9 namespace password_generation { |
| 10 |
| 11 PasswordGenerationActions::PasswordGenerationActions() |
| 12 : learn_more_visited(false), |
| 13 password_accepted(false), |
| 14 password_edited(false), |
| 15 password_regenerated(false) { |
| 16 } |
| 17 |
| 18 PasswordGenerationActions::~PasswordGenerationActions() { |
| 19 } |
| 20 |
| 21 void LogUserActions(PasswordGenerationActions actions) { |
| 22 UserAction action; |
| 23 if (actions.password_accepted) { |
| 24 if (actions.password_edited) |
| 25 action = ACCEPT_AFTER_EDITING; |
| 26 else |
| 27 action = ACCEPT_ORIGINAL_PASSWORD; |
| 28 } else if (actions.learn_more_visited) { |
| 29 action = LEARN_MORE; |
| 30 } else { |
| 31 action = IGNORE; |
| 32 } |
| 33 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.UserActions", |
| 34 action, ACTION_ENUM_COUNT); |
| 35 } |
| 36 |
| 37 void LogPasswordGenerationEvents(PasswordGenerationEvent event) { |
| 38 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.Events", |
| 39 event, EVENT_ENUM_COUNT); |
| 40 } |
| 41 |
| 42 } // namespace password_generation |
| OLD | NEW |