| 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 14 matching lines...) Expand all Loading... |
| 25 const char kSignInPromoQueryKeyConstrained[] = "constrained"; | 25 const char kSignInPromoQueryKeyConstrained[] = "constrained"; |
| 26 const char kSignInPromoQueryKeyShowAccountManagement[] = | 26 const char kSignInPromoQueryKeyShowAccountManagement[] = |
| 27 "showAccountManagement"; | 27 "showAccountManagement"; |
| 28 | 28 |
| 29 enum Source { | 29 enum Source { |
| 30 SOURCE_START_PAGE = 0, // This must be first. | 30 SOURCE_START_PAGE = 0, // This must be first. |
| 31 SOURCE_NTP_LINK, | 31 SOURCE_NTP_LINK, |
| 32 SOURCE_MENU, | 32 SOURCE_MENU, |
| 33 SOURCE_SETTINGS, | 33 SOURCE_SETTINGS, |
| 34 SOURCE_EXTENSION_INSTALL_BUBBLE, | 34 SOURCE_EXTENSION_INSTALL_BUBBLE, |
| 35 SOURCE_WEBSTORE_INSTALL, | |
| 36 SOURCE_APP_LAUNCHER, | 35 SOURCE_APP_LAUNCHER, |
| 37 SOURCE_APPS_PAGE_LINK, | 36 SOURCE_APPS_PAGE_LINK, |
| 38 SOURCE_BOOKMARK_BUBBLE, | 37 SOURCE_BOOKMARK_BUBBLE, |
| 39 SOURCE_AVATAR_BUBBLE_SIGN_IN, | 38 SOURCE_AVATAR_BUBBLE_SIGN_IN, |
| 40 SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT, | 39 SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT, |
| 41 SOURCE_DEVICES_PAGE, | 40 SOURCE_DEVICES_PAGE, |
| 42 SOURCE_REAUTH, | 41 SOURCE_REAUTH, |
| 43 SOURCE_UNKNOWN, // This must be last. | 42 SOURCE_UNKNOWN, // This must be last. |
| 44 }; | 43 }; |
| 45 | 44 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 | 61 |
| 63 // Returns the sign in promo URL wth the given arguments in the query. | 62 // Returns the sign in promo URL wth the given arguments in the query. |
| 64 // |source| identifies from where the sign in promo is being called, and is | 63 // |source| identifies from where the sign in promo is being called, and is |
| 65 // used to record sync promo UMA stats in the context of the source. | 64 // used to record sync promo UMA stats in the context of the source. |
| 66 // |auto_close| whether to close the sign in promo automatically when done. | 65 // |auto_close| whether to close the sign in promo automatically when done. |
| 67 // |is_constrained} whether to load the URL in a constrained window, false | 66 // |is_constrained} whether to load the URL in a constrained window, false |
| 68 // by default. | 67 // by default. |
| 69 GURL GetPromoURL(Source source, bool auto_close); | 68 GURL GetPromoURL(Source source, bool auto_close); |
| 70 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained); | 69 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained); |
| 71 | 70 |
| 72 // As above, but also appends the |continue_url| as a parameter to the URL. | |
| 73 // A |continue_url| may be set only when not using the web-based sign-in flow. | |
| 74 GURL GetPromoURLWithContinueURL(Source source, | |
| 75 bool auto_close, | |
| 76 bool is_constrained, | |
| 77 GURL continue_url); | |
| 78 | |
| 79 // Returns a sign in promo URL specifically for reauthenticating |account_id|. | 71 // Returns a sign in promo URL specifically for reauthenticating |account_id|. |
| 80 GURL GetReauthURL(Profile* profile, const std::string& account_id); | 72 GURL GetReauthURL(Profile* profile, const std::string& account_id); |
| 81 | 73 |
| 82 // Gets the next page URL from the query portion of the sign in promo URL. | 74 // Gets the next page URL from the query portion of the sign in promo URL. |
| 83 GURL GetNextPageURLForPromoURL(const GURL& url); | 75 GURL GetNextPageURLForPromoURL(const GURL& url); |
| 84 | 76 |
| 85 // Gets the source from the query portion of the sign in promo URL. | 77 // Gets the source from the query portion of the sign in promo URL. |
| 86 // The source identifies from where the sign in promo was opened. | 78 // The source identifies from where the sign in promo was opened. |
| 87 Source GetSourceForPromoURL(const GURL& url); | 79 Source GetSourceForPromoURL(const GURL& url); |
| 88 | 80 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 100 | 92 |
| 101 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 93 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
| 102 void ForceWebBasedSigninFlowForTesting(bool force); | 94 void ForceWebBasedSigninFlowForTesting(bool force); |
| 103 | 95 |
| 104 // Registers the preferences the Sign In Promo needs. | 96 // Registers the preferences the Sign In Promo needs. |
| 105 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 97 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 106 | 98 |
| 107 } // namespace signin | 99 } // namespace signin |
| 108 | 100 |
| 109 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ | 101 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROMO_H_ |
| OLD | NEW |