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; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 static void SetUserSkippedSyncPromo(Profile* profile); | 45 static void SetUserSkippedSyncPromo(Profile* profile); |
46 | 46 |
47 // Registers the preferences the Sync Promo UI needs. | 47 // Registers the preferences the Sync Promo UI needs. |
48 static void RegisterUserPrefs(PrefService* prefs); | 48 static void RegisterUserPrefs(PrefService* prefs); |
49 | 49 |
50 // Returns the sync promo URL wth the given arguments in the query. | 50 // Returns the sync promo URL wth the given arguments in the query. |
51 // |next_page| is the URL to navigate to when the user completes or skips the | 51 // |next_page| is the URL to navigate to when the user completes or skips the |
52 // promo. If an empty URL is given then the promo will navigate to the NTP. | 52 // promo. If an empty URL is given then the promo will navigate to the NTP. |
53 // |source| identifies from where the sync promo is being called, and is used | 53 // |source| identifies from where the sync promo is being called, and is used |
54 // to record sync promo UMA stats in the context of the source. | 54 // to record sync promo UMA stats in the context of the source. |
55 static GURL GetSyncPromoURL(const GURL& next_page, Source source); | 55 // |auto_close| whether to close the sync promo automatically when done. |
| 56 static GURL GetSyncPromoURL( |
| 57 const GURL& next_page, Source source, bool auto_close); |
56 | 58 |
57 // Gets the next page URL from the query portion of the sync promo URL. | 59 // Gets the next page URL from the query portion of the sync promo URL. |
58 static GURL GetNextPageURLForSyncPromoURL(const GURL& url); | 60 static GURL GetNextPageURLForSyncPromoURL(const GURL& url); |
59 | 61 |
60 // Gets the source from the query portion of the sync promo URL. | 62 // Gets the source from the query portion of the sync promo URL. |
61 // The source identifies from where the sync promo was opened. | 63 // The source identifies from where the sync promo was opened. |
62 static Source GetSourceForSyncPromoURL(const GURL& url); | 64 static Source GetSourceForSyncPromoURL(const GURL& url); |
63 | 65 |
| 66 // Returns whether the given sync URL contains auto_close parameter. |
| 67 static bool GetAutoCloseForSyncPromoURL(const GURL& url); |
| 68 |
64 private: | 69 private: |
65 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 70 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
66 }; | 71 }; |
67 | 72 |
68 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 73 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
OLD | NEW |