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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Returns the sign in promo URL wth the given arguments in the query. | 54 // Returns the sign in promo URL wth the given arguments in the query. |
55 // |source| identifies from where the sign in promo is being called, and is | 55 // |source| identifies from where the sign in promo is being called, and is |
56 // used to record sync promo UMA stats in the context of the source. | 56 // used to record sync promo UMA stats in the context of the source. |
57 // |auto_close| whether to close the sign in promo automatically when done. | 57 // |auto_close| whether to close the sign in promo automatically when done. |
58 // |is_constrained} whether to load the URL in a constrained window, false | 58 // |is_constrained} whether to load the URL in a constrained window, false |
59 // by default. | 59 // by default. |
60 GURL GetPromoURL(Source source, bool auto_close); | 60 GURL GetPromoURL(Source source, bool auto_close); |
61 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained); | 61 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained); |
62 | 62 |
| 63 // As above, but also appends the |continue_url| as a parameter to the URL. |
| 64 // A |continue_url| may be set only when not using the web-based sign-in flow. |
| 65 GURL GetPromoURLWithContinueURL(Source source, |
| 66 bool auto_close, |
| 67 bool is_constrained, |
| 68 GURL continue_url); |
| 69 |
63 // Returns a sign in promo URL specifically for reauthenticating |account_id|. | 70 // Returns a sign in promo URL specifically for reauthenticating |account_id|. |
64 GURL GetReauthURL(Profile* profile, const std::string& account_id); | 71 GURL GetReauthURL(Profile* profile, const std::string& account_id); |
65 | 72 |
66 // Gets the next page URL from the query portion of the sign in promo URL. | 73 // Gets the next page URL from the query portion of the sign in promo URL. |
67 GURL GetNextPageURLForPromoURL(const GURL& url); | 74 GURL GetNextPageURLForPromoURL(const GURL& url); |
68 | 75 |
69 // Gets the source from the query portion of the sign in promo URL. | 76 // Gets the source from the query portion of the sign in promo URL. |
70 // The source identifies from where the sign in promo was opened. | 77 // The source identifies from where the sign in promo was opened. |
71 Source GetSourceForPromoURL(const GURL& url); | 78 Source GetSourceForPromoURL(const GURL& url); |
72 | 79 |
73 // Returns true if the auto_close parameter in the given URL is set to true. | 80 // Returns true if the auto_close parameter in the given URL is set to true. |
74 bool IsAutoCloseEnabledInURL(const GURL& url); | 81 bool IsAutoCloseEnabledInURL(const GURL& url); |
75 | 82 |
76 // Returns true if the given URL is the standard continue URL used with the | 83 // Returns true if the given URL is the standard continue URL used with the |
77 // sync promo when the web-based flow is enabled. The query parameters | 84 // sync promo when the web-based flow is enabled. The query parameters |
78 // of the URL are ignored for this comparison. | 85 // of the URL are ignored for this comparison. |
79 bool IsContinueUrlForWebBasedSigninFlow(const GURL& url); | 86 bool IsContinueUrlForWebBasedSigninFlow(const GURL& url); |
80 | 87 |
81 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 88 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
82 void ForceWebBasedSigninFlowForTesting(bool force); | 89 void ForceWebBasedSigninFlowForTesting(bool force); |
83 | 90 |
84 // Registers the preferences the Sign In Promo needs. | 91 // Registers the preferences the Sign In Promo needs. |
85 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 92 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
86 | 93 |
87 } // namespace signin | 94 } // namespace signin |
88 | 95 |
89 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ | 96 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ |
OLD | NEW |