| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/web_ui_controller.h" | 8 #include "content/public/browser/web_ui_controller.h" |
| 9 | 9 |
| 10 class Profile; | 10 class Profile; |
| 11 |
| 12 namespace user_prefs { |
| 11 class PrefRegistrySyncable; | 13 class PrefRegistrySyncable; |
| 14 } |
| 12 | 15 |
| 13 // The Web UI handler for chrome://signin. | 16 // The Web UI handler for chrome://signin. |
| 14 class SyncPromoUI : public content::WebUIController { | 17 class SyncPromoUI : public content::WebUIController { |
| 15 public: | 18 public: |
| 16 // Please keep this in sync with enums in sync_promo_trial.cc. | 19 // Please keep this in sync with enums in sync_promo_trial.cc. |
| 17 enum Source { | 20 enum Source { |
| 18 SOURCE_START_PAGE = 0, // This must be first. | 21 SOURCE_START_PAGE = 0, // This must be first. |
| 19 SOURCE_NTP_LINK, | 22 SOURCE_NTP_LINK, |
| 20 SOURCE_MENU, | 23 SOURCE_MENU, |
| 21 SOURCE_SETTINGS, | 24 SOURCE_SETTINGS, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 43 // Returns true if a user has seen the sync promo at startup previously. | 46 // Returns true if a user has seen the sync promo at startup previously. |
| 44 static bool HasShownPromoAtStartup(Profile* profile); | 47 static bool HasShownPromoAtStartup(Profile* profile); |
| 45 | 48 |
| 46 // Returns true if the user has previously skipped the sync promo. | 49 // Returns true if the user has previously skipped the sync promo. |
| 47 static bool HasUserSkippedSyncPromo(Profile* profile); | 50 static bool HasUserSkippedSyncPromo(Profile* profile); |
| 48 | 51 |
| 49 // Registers the fact that the user has skipped the sync promo. | 52 // Registers the fact that the user has skipped the sync promo. |
| 50 static void SetUserSkippedSyncPromo(Profile* profile); | 53 static void SetUserSkippedSyncPromo(Profile* profile); |
| 51 | 54 |
| 52 // Registers the preferences the Sync Promo UI needs. | 55 // Registers the preferences the Sync Promo UI needs. |
| 53 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 56 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 54 | 57 |
| 55 // Gets the sync landing page URL. | 58 // Gets the sync landing page URL. |
| 56 static std::string GetSyncLandingURL(const char* option, int value); | 59 static std::string GetSyncLandingURL(const char* option, int value); |
| 57 | 60 |
| 58 // Returns the sync promo URL wth the given arguments in the query. | 61 // Returns the sync promo URL wth the given arguments in the query. |
| 59 // |next_page| is the URL to navigate to when the user completes or skips the | 62 // |next_page| is the URL to navigate to when the user completes or skips the |
| 60 // promo. If an empty URL is given then the promo will navigate to the NTP. | 63 // promo. If an empty URL is given then the promo will navigate to the NTP. |
| 61 // |source| identifies from where the sync promo is being called, and is used | 64 // |source| identifies from where the sync promo is being called, and is used |
| 62 // to record sync promo UMA stats in the context of the source. | 65 // to record sync promo UMA stats in the context of the source. |
| 63 // |auto_close| whether to close the sync promo automatically when done. | 66 // |auto_close| whether to close the sync promo automatically when done. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 85 static bool IsContinueUrlForWebBasedSigninFlow(const GURL& url); | 88 static bool IsContinueUrlForWebBasedSigninFlow(const GURL& url); |
| 86 | 89 |
| 87 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 90 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
| 88 static void ForceWebBasedSigninFlowForTesting(bool force); | 91 static void ForceWebBasedSigninFlowForTesting(bool force); |
| 89 | 92 |
| 90 private: | 93 private: |
| 91 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 94 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
| OLD | NEW |