Chromium Code Reviews| 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H_ |
| 7 | 7 |
| 8 class PrefRegistrySimple; | 8 class PrefRegistrySimple; |
| 9 class PrefService; | 9 class PrefService; |
| 10 | 10 |
| 11 namespace syncer { | 11 namespace syncer { |
| 12 class SyncService; | 12 class SyncService; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace password_bubble_experiment { | 15 namespace password_bubble_experiment { |
| 16 | 16 |
| 17 extern const char kBrandingExperimentName[]; | |
| 18 extern const char kChromeSignInPasswordPromoExperimentName[]; | 17 extern const char kChromeSignInPasswordPromoExperimentName[]; |
| 19 extern const char kChromeSignInPasswordPromoThresholdParam[]; | 18 extern const char kChromeSignInPasswordPromoThresholdParam[]; |
| 20 extern const char kSmartBubbleExperimentName[]; | 19 extern const char kSmartBubbleExperimentName[]; |
| 21 extern const char kSmartBubbleThresholdParam[]; | 20 extern const char kSmartBubbleThresholdParam[]; |
| 22 extern const char kSmartLockBrandingGroupName[]; | |
| 23 extern const char kSmartLockBrandingSavePromptOnlyGroupName[]; | |
| 24 | 21 |
| 25 // Registers prefs which controls appearance of the first run experience for the | 22 // Registers prefs which controls appearance of the first run experience for the |
| 26 // Smart Lock UI, namely was first run experience shown for save prompt or auto | 23 // Smart Lock UI, namely was first run experience shown for save prompt or auto |
| 27 // sign-in prompt. | 24 // sign-in prompt. |
| 28 void RegisterPrefs(PrefRegistrySimple* registry); | 25 void RegisterPrefs(PrefRegistrySimple* registry); |
| 29 | 26 |
| 30 // Returns the number of times the "Save password" bubble can be dismissed by | 27 // Returns the number of times the "Save password" bubble can be dismissed by |
| 31 // user before it's not shown automatically. | 28 // user before it's not shown automatically. |
| 32 int GetSmartBubbleDismissalThreshold(); | 29 int GetSmartBubbleDismissalThreshold(); |
| 33 | 30 |
| 34 // A Smart Lock user is a sync user without a custom passphrase. | 31 // A Smart Lock user is a sync user without a custom passphrase. |
| 35 bool IsSmartLockUser(const syncer::SyncService* sync_service); | 32 bool IsSmartLockUser(const syncer::SyncService* sync_service); |
| 36 | 33 |
| 37 enum class SmartLockBranding { NONE, FULL, SAVE_PROMPT_ONLY }; | |
| 38 | |
| 39 // If the user is not a Smart Lock user, returns NONE. For Smart Lock users: | |
| 40 // * returns NONE if the password manager should not be referred to as Smart | |
| 41 // Lock anywhere; | |
| 42 // * returns FULL, if it should be referred to as Smart Lock everywhere; | |
| 43 // * returns SAVE_PROMPT_ONLY if it only should be referred to as Smart Lock in | |
| 44 // the save password bubble. | |
| 45 SmartLockBranding GetSmartLockBrandingState( | |
| 46 const syncer::SyncService* sync_service); | |
| 47 | |
| 48 // Convenience function for checking whether the result of | |
| 49 // GetSmartLockBrandingState is SmartLockBranding::FULL. | |
| 50 bool IsSmartLockBrandingEnabled(const syncer::SyncService* sync_service); | |
| 51 | |
| 52 // Convenience function for checking whether the result of | |
| 53 // GetSmartLockBrandingState is not equal to SmartLockBranding::NONE. | |
| 54 bool IsSmartLockBrandingSavePromptEnabled( | |
| 55 const syncer::SyncService* sync_service); | |
| 56 | |
| 57 // Returns true if save prompt should contain first run experience. | 34 // Returns true if save prompt should contain first run experience. |
| 58 bool ShouldShowSavePromptFirstRunExperience( | 35 bool ShouldShowSavePromptFirstRunExperience( |
|
vasilii
2016/12/16 16:56:53
TODO: remove too
vabr (Chromium)
2016/12/16 18:56:27
Done.
| |
| 59 const syncer::SyncService* sync_service, | 36 const syncer::SyncService* sync_service, |
| 60 PrefService* prefs); | 37 PrefService* prefs); |
| 61 | 38 |
| 62 // Sets appropriate value to the preference which controls appearance of the | |
| 63 // first run experience for the save prompt. | |
| 64 void RecordSavePromptFirstRunExperienceWasShown(PrefService* prefs); | |
| 65 | |
| 66 // Returns true if first run experience for auto sign-in prompt should be shown. | 39 // Returns true if first run experience for auto sign-in prompt should be shown. |
| 67 bool ShouldShowAutoSignInPromptFirstRunExperience(PrefService* prefs); | 40 bool ShouldShowAutoSignInPromptFirstRunExperience(PrefService* prefs); |
| 68 | 41 |
| 69 // Sets appropriate value to the preference which controls appearance of the | 42 // Sets appropriate value to the preference which controls appearance of the |
| 70 // first run experience for the auto sign-in prompt. | 43 // first run experience for the auto sign-in prompt. |
| 71 void RecordAutoSignInPromptFirstRunExperienceWasShown(PrefService* prefs); | 44 void RecordAutoSignInPromptFirstRunExperienceWasShown(PrefService* prefs); |
| 72 | 45 |
| 73 // Turns off the auto signin experience setting. | 46 // Turns off the auto signin experience setting. |
| 74 void TurnOffAutoSignin(PrefService* prefs); | 47 void TurnOffAutoSignin(PrefService* prefs); |
| 75 | 48 |
| 76 // Returns true if the Chrome Sign In promo should be shown. | 49 // Returns true if the Chrome Sign In promo should be shown. |
| 77 bool ShouldShowChromeSignInPasswordPromo( | 50 bool ShouldShowChromeSignInPasswordPromo( |
| 78 PrefService* prefs, | 51 PrefService* prefs, |
| 79 const syncer::SyncService* sync_service); | 52 const syncer::SyncService* sync_service); |
| 80 | 53 |
| 81 } // namespace password_bubble_experiment | 54 } // namespace password_bubble_experiment |
| 82 | 55 |
| 83 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H _ | 56 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_BUBBLE_EXPERIMENT_H _ |
| OLD | NEW |