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 21 matching lines...) Expand all Loading... |
43 // Returns true if a user has seen the sync promo at startup previously. | 43 // Returns true if a user has seen the sync promo at startup previously. |
44 static bool HasShownPromoAtStartup(Profile* profile); | 44 static bool HasShownPromoAtStartup(Profile* profile); |
45 | 45 |
46 // Returns true if the user has previously skipped the sync promo. | 46 // Returns true if the user has previously skipped the sync promo. |
47 static bool HasUserSkippedSyncPromo(Profile* profile); | 47 static bool HasUserSkippedSyncPromo(Profile* profile); |
48 | 48 |
49 // Registers the fact that the user has skipped the sync promo. | 49 // Registers the fact that the user has skipped the sync promo. |
50 static void SetUserSkippedSyncPromo(Profile* profile); | 50 static void SetUserSkippedSyncPromo(Profile* profile); |
51 | 51 |
52 // Registers the preferences the Sync Promo UI needs. | 52 // Registers the preferences the Sync Promo UI needs. |
53 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 53 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
54 | 54 |
55 // Returns the sync promo URL wth the given arguments in the query. | 55 // Returns the sync promo URL wth the given arguments in the query. |
56 // |next_page| is the URL to navigate to when the user completes or skips the | 56 // |next_page| is the URL to navigate to when the user completes or skips the |
57 // promo. If an empty URL is given then the promo will navigate to the NTP. | 57 // promo. If an empty URL is given then the promo will navigate to the NTP. |
58 // |source| identifies from where the sync promo is being called, and is used | 58 // |source| identifies from where the sync promo is being called, and is used |
59 // to record sync promo UMA stats in the context of the source. | 59 // to record sync promo UMA stats in the context of the source. |
60 // |auto_close| whether to close the sync promo automatically when done. | 60 // |auto_close| whether to close the sync promo automatically when done. |
61 static GURL GetSyncPromoURL( | 61 static GURL GetSyncPromoURL( |
62 const GURL& next_page, Source source, bool auto_close); | 62 const GURL& next_page, Source source, bool auto_close); |
63 | 63 |
(...skipping 13 matching lines...) Expand all Loading... |
77 static bool UseWebBasedSigninFlow(); | 77 static bool UseWebBasedSigninFlow(); |
78 | 78 |
79 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 79 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
80 static void ForceWebBasedSigninFlowForTesting(bool force); | 80 static void ForceWebBasedSigninFlowForTesting(bool force); |
81 | 81 |
82 private: | 82 private: |
83 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 83 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 86 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
OLD | NEW |