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