password_generation_util.cc revision 7d4cd473f85ac64c3747c96c277f9e506a0d2246
1// Copyright 2013 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 "components/autofill/core/common/password_generation_util.h" 6 7#include "base/metrics/histogram.h" 8 9namespace autofill { 10namespace password_generation { 11 12PasswordGenerationActions::PasswordGenerationActions() 13 : learn_more_visited(false), 14 password_accepted(false), 15 password_edited(false), 16 password_regenerated(false) { 17} 18 19PasswordGenerationActions::~PasswordGenerationActions() { 20} 21 22void LogUserActions(PasswordGenerationActions actions) { 23 UserAction action = IGNORE_FEATURE; 24 if (actions.password_accepted) { 25 if (actions.password_edited) 26 action = ACCEPT_AFTER_EDITING; 27 else 28 action = ACCEPT_ORIGINAL_PASSWORD; 29 } else if (actions.learn_more_visited) { 30 action = LEARN_MORE; 31 } 32 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.UserActions", 33 action, ACTION_ENUM_COUNT); 34} 35 36void LogPasswordGenerationEvent(PasswordGenerationEvent event) { 37 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.Event", 38 event, EVENT_ENUM_COUNT); 39} 40 41} // namespace password_generation 42} // namespace autofill 43