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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/public/browser/web_ui_controller.h" | 9 #include "content/public/browser/web_ui_controller.h" |
10 | 10 |
11 class Profile; | 11 class Profile; |
12 class PrefService; | 12 class PrefService; |
13 | 13 |
14 // The Web UI handler for chrome://syncpromo. | 14 // The Web UI handler for chrome://syncpromo. |
15 class SyncPromoUI : public content::WebUIController { | 15 class SyncPromoUI : public content::WebUIController { |
16 public: | 16 public: |
| 17 enum Version { |
| 18 VERSION_DEFAULT = 0, |
| 19 VERSION_DEVICES, |
| 20 VERSION_VERBOSE, |
| 21 VERSION_SIMPLE, |
| 22 VERSION_DIALOG, |
| 23 VERSION_COUNT, |
| 24 }; |
| 25 |
17 // Constructs a SyncPromoUI. | 26 // Constructs a SyncPromoUI. |
18 explicit SyncPromoUI(content::WebUI* web_ui); | 27 explicit SyncPromoUI(content::WebUI* web_ui); |
19 | 28 |
20 // Returns true if the sync promo should be visible. | 29 // Returns true if the sync promo should be visible. |
21 // |profile| is the profile of the tab the promo would be shown on. | 30 // |profile| is the profile of the tab the promo would be shown on. |
22 static bool ShouldShowSyncPromo(Profile* profile); | 31 static bool ShouldShowSyncPromo(Profile* profile); |
23 | 32 |
24 // Returns true if we should show the sync promo at startup. | 33 // Returns true if we should show the sync promo at startup. |
25 static bool ShouldShowSyncPromoAtStartup(Profile* profile, | 34 static bool ShouldShowSyncPromoAtStartup(Profile* profile, |
26 bool is_new_profile); | 35 bool is_new_profile); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 69 |
61 // Gets the source from the query portion of the sync promo URL. | 70 // Gets the source from the query portion of the sync promo URL. |
62 static std::string GetSourceForSyncPromoURL(const GURL& url); | 71 static std::string GetSourceForSyncPromoURL(const GURL& url); |
63 | 72 |
64 // Returns true if the sync promo page was ever shown at startup. | 73 // Returns true if the sync promo page was ever shown at startup. |
65 static bool UserHasSeenSyncPromoAtStartup(Profile* profile); | 74 static bool UserHasSeenSyncPromoAtStartup(Profile* profile); |
66 | 75 |
67 // Returns the version of the sync promo UI that we should display. | 76 // Returns the version of the sync promo UI that we should display. |
68 // Each version changes the UI slightly (for example, replacing text with | 77 // Each version changes the UI slightly (for example, replacing text with |
69 // an infographic). | 78 // an infographic). |
70 static int GetSyncPromoVersion(); | 79 static Version GetSyncPromoVersion(); |
71 | 80 |
72 private: | 81 private: |
73 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 82 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
74 }; | 83 }; |
75 | 84 |
76 #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 |