| 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 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 9 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 10 | 10 |
| 11 namespace user_prefs { | 11 namespace user_prefs { |
| 12 class PrefRegistrySyncable; | 12 class PrefRegistrySyncable; |
| 13 } | 13 } |
| 14 | 14 |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 // These functions handle the algorithms according to which the "Save password?" | 17 // These functions handle the algorithms according to which the "Save password?" |
| 18 // bubble is shown to user. | 18 // bubble shows "No thanks" or "Never for this site" button default. |
| 19 namespace password_bubble_experiment { | 19 namespace password_bubble_experiment { |
| 20 | 20 |
| 21 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry); | 21 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 22 | 22 |
| 23 // The decision is made based on the "PasswordBubbleAlgorithm" finch experiment. | 23 // Returns true if "Never for this site" should be the default negative option. |
| 24 // The default value is true. | 24 // Otherwise it's "No thanks". The default value is false. |
| 25 // It should be called before showing the "Save Password?" dialog. | 25 // It should be called before showing the "Save Password?" dialog. |
| 26 bool ShouldShowBubble(PrefService* prefs); | 26 bool ShouldShowNeverForThisSiteDefault(PrefService* prefs); |
| 27 | 27 |
| 28 // Should be called when user dismisses the "Save Password?" dialog. It stores | 28 // Should be called when user dismisses the "Save Password?" dialog. It stores |
| 29 // the statistics about interactions with the bubble. | 29 // the statistics about interactions with the bubble. |
| 30 void RecordBubbleClosed( | 30 void RecordBubbleClosed( |
| 31 PrefService* prefs, | 31 PrefService* prefs, |
| 32 password_manager::metrics_util::UIDismissalReason reason); | 32 password_manager::metrics_util::UIDismissalReason reason); |
| 33 | 33 |
| 34 // The name of the finch experiment controlling the algorithm. | 34 // The name of the finch experiment controlling the algorithm. |
| 35 extern const char kExperimentName[]; | 35 extern const char kExperimentName[]; |
| 36 | 36 |
| 37 // The group name for the time based algorithm. | 37 // The name of the finch parameter. It signifies the consecutive nopes |
| 38 extern const char kGroupTimeSpanBased[]; | 38 // threshold after which the user sees "Never for this site" button by default. |
| 39 | 39 extern const char kParamNopeThreshold[]; |
| 40 // The group name for the probability algorithm. | |
| 41 extern const char kGroupProbabilityBased[]; | |
| 42 | |
| 43 // For "Probability" group. The additional "Saves" to be added to the model. | |
| 44 extern const char kParamProbabilityFakeSaves[]; | |
| 45 | |
| 46 // For "Probability" group. The interaction history length. | |
| 47 extern const char kParamProbabilityInteractionsCount[]; | |
| 48 | |
| 49 // For "TimeSpan" group. The time span until the nope counter is zeroed. | |
| 50 extern const char kParamTimeSpan[]; | |
| 51 | |
| 52 // For "TimeSpan" group. The nopes threshold. | |
| 53 extern const char kParamTimeSpanNopeThreshold[]; | |
| 54 | 40 |
| 55 } // namespace password_bubble_experiment | 41 } // namespace password_bubble_experiment |
| 56 | 42 |
| 57 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ | 43 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_BUBBLE_EXPERIMENT_H_ |
| OLD | NEW |