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 class PrefServiceSyncable; | 11 class PrefRegistrySyncable; |
12 | 12 |
13 // The Web UI handler for chrome://signin. | 13 // The Web UI handler for chrome://signin. |
14 class SyncPromoUI : public content::WebUIController { | 14 class SyncPromoUI : public content::WebUIController { |
15 public: | 15 public: |
16 // Please keep this in sync with enums in sync_promo_trial.cc. | 16 // Please keep this in sync with enums in sync_promo_trial.cc. |
17 enum Source { | 17 enum Source { |
18 SOURCE_START_PAGE = 0, // This must be first. | 18 SOURCE_START_PAGE = 0, // This must be first. |
19 SOURCE_NTP_LINK, | 19 SOURCE_NTP_LINK, |
20 SOURCE_MENU, | 20 SOURCE_MENU, |
21 SOURCE_SETTINGS, | 21 SOURCE_SETTINGS, |
(...skipping 20 matching lines...) Expand all Loading... |
42 // Returns true if a user has seen the sync promo at startup previously. | 42 // Returns true if a user has seen the sync promo at startup previously. |
43 static bool HasShownPromoAtStartup(Profile* profile); | 43 static bool HasShownPromoAtStartup(Profile* profile); |
44 | 44 |
45 // Returns true if the user has previously skipped the sync promo. | 45 // Returns true if the user has previously skipped the sync promo. |
46 static bool HasUserSkippedSyncPromo(Profile* profile); | 46 static bool HasUserSkippedSyncPromo(Profile* profile); |
47 | 47 |
48 // Registers the fact that the user has skipped the sync promo. | 48 // Registers the fact that the user has skipped the sync promo. |
49 static void SetUserSkippedSyncPromo(Profile* profile); | 49 static void SetUserSkippedSyncPromo(Profile* profile); |
50 | 50 |
51 // Registers the preferences the Sync Promo UI needs. | 51 // Registers the preferences the Sync Promo UI needs. |
52 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 52 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
53 | 53 |
54 // Returns the sync promo URL wth the given arguments in the query. | 54 // Returns the sync promo URL wth the given arguments in the query. |
55 // |next_page| is the URL to navigate to when the user completes or skips the | 55 // |next_page| is the URL to navigate to when the user completes or skips the |
56 // promo. If an empty URL is given then the promo will navigate to the NTP. | 56 // promo. If an empty URL is given then the promo will navigate to the NTP. |
57 // |source| identifies from where the sync promo is being called, and is used | 57 // |source| identifies from where the sync promo is being called, and is used |
58 // to record sync promo UMA stats in the context of the source. | 58 // to record sync promo UMA stats in the context of the source. |
59 // |auto_close| whether to close the sync promo automatically when done. | 59 // |auto_close| whether to close the sync promo automatically when done. |
60 static GURL GetSyncPromoURL( | 60 static GURL GetSyncPromoURL( |
61 const GURL& next_page, Source source, bool auto_close); | 61 const GURL& next_page, Source source, bool auto_close); |
62 | 62 |
(...skipping 13 matching lines...) Expand all Loading... |
76 static bool UseWebBasedSigninFlow(); | 76 static bool UseWebBasedSigninFlow(); |
77 | 77 |
78 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 78 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
79 static void ForceWebBasedSigninFlowForTesting(bool force); | 79 static void ForceWebBasedSigninFlowForTesting(bool force); |
80 | 80 |
81 private: | 81 private: |
82 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 82 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 85 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
OLD | NEW |