| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_SIGNIN_SIGNIN_PROMO_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ | 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SOURCE_APP_LAUNCHER, | 36 SOURCE_APP_LAUNCHER, |
| 37 SOURCE_APPS_PAGE_LINK, | 37 SOURCE_APPS_PAGE_LINK, |
| 38 SOURCE_BOOKMARK_BUBBLE, | 38 SOURCE_BOOKMARK_BUBBLE, |
| 39 SOURCE_AVATAR_BUBBLE_SIGN_IN, | 39 SOURCE_AVATAR_BUBBLE_SIGN_IN, |
| 40 SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT, | 40 SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT, |
| 41 SOURCE_DEVICES_PAGE, | 41 SOURCE_DEVICES_PAGE, |
| 42 SOURCE_REAUTH, | 42 SOURCE_REAUTH, |
| 43 SOURCE_UNKNOWN, // This must be last. | 43 SOURCE_UNKNOWN, // This must be last. |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Enum values used for Android signin promo actions. |
| 47 enum AndroidSigninPromoAction { |
| 48 // The promo was enabled. |
| 49 HISTOGRAM_ANDROID_SIGNIN_PROMO_ENABLED = 0, |
| 50 |
| 51 // The promo was shown. |
| 52 HISTOGRAM_ANDROID_SIGNIN_PROMO_SHOWN, |
| 53 |
| 54 // The promo was declined. |
| 55 HISTOGRAM_ANDROID_SIGNIN_PROMO_DECLINED, |
| 56 |
| 57 // The promo was accepted. |
| 58 HISTOGRAM_ANDROID_SIGNIN_PROMO_ACCEPTED, |
| 59 |
| 60 // The promo was accepted and user clicked the settings link. |
| 61 HISTOGRAM_ANDROID_SIGNIN_PROMO_ACCEPTED_WITH_ADVANCED, |
| 62 |
| 63 HISTOGRAM_ANDROID_SIGNIN_PROMO_MAX, |
| 64 }; |
| 65 |
| 46 // Returns true if the sign in promo should be visible. | 66 // Returns true if the sign in promo should be visible. |
| 47 // |profile| is the profile of the tab the promo would be shown on. | 67 // |profile| is the profile of the tab the promo would be shown on. |
| 48 bool ShouldShowPromo(Profile* profile); | 68 bool ShouldShowPromo(Profile* profile); |
| 49 | 69 |
| 50 // Returns true if we should show the sign in promo at startup. | 70 // Returns true if we should show the sign in promo at startup. |
| 51 bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile); | 71 bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile); |
| 52 | 72 |
| 53 // Called when the sign in promo has been shown so that we can keep track | 73 // Called when the sign in promo has been shown so that we can keep track |
| 54 // of the number of times we've displayed it. | 74 // of the number of times we've displayed it. |
| 55 void DidShowPromoAtStartup(Profile* profile); | 75 void DidShowPromoAtStartup(Profile* profile); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 120 |
| 101 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 121 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
| 102 void ForceWebBasedSigninFlowForTesting(bool force); | 122 void ForceWebBasedSigninFlowForTesting(bool force); |
| 103 | 123 |
| 104 // Registers the preferences the Sign In Promo needs. | 124 // Registers the preferences the Sign In Promo needs. |
| 105 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 125 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 106 | 126 |
| 107 } // namespace signin | 127 } // namespace signin |
| 108 | 128 |
| 109 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ | 129 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ |
| OLD | NEW |