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 PrefRegistrySyncable; | 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, |
22 SOURCE_EXTENSION_INSTALL_BUBBLE, | 22 SOURCE_EXTENSION_INSTALL_BUBBLE, |
23 SOURCE_WEBSTORE_INSTALL, | 23 SOURCE_WEBSTORE_INSTALL, |
24 SOURCE_APP_LAUNCHER, | 24 SOURCE_APP_LAUNCHER, |
| 25 SOURCE_APPS_PAGE_LINK, |
25 SOURCE_UNKNOWN, // This must be last. | 26 SOURCE_UNKNOWN, // This must be last. |
26 }; | 27 }; |
27 | 28 |
28 // Constructs a SyncPromoUI. | 29 // Constructs a SyncPromoUI. |
29 explicit SyncPromoUI(content::WebUI* web_ui); | 30 explicit SyncPromoUI(content::WebUI* web_ui); |
30 | 31 |
31 // Returns true if the sync promo should be visible. | 32 // Returns true if the sync promo should be visible. |
32 // |profile| is the profile of the tab the promo would be shown on. | 33 // |profile| is the profile of the tab the promo would be shown on. |
33 static bool ShouldShowSyncPromo(Profile* profile); | 34 static bool ShouldShowSyncPromo(Profile* profile); |
34 | 35 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 static bool UseWebBasedSigninFlow(); | 78 static bool UseWebBasedSigninFlow(); |
78 | 79 |
79 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. | 80 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. |
80 static void ForceWebBasedSigninFlowForTesting(bool force); | 81 static void ForceWebBasedSigninFlowForTesting(bool force); |
81 | 82 |
82 private: | 83 private: |
83 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); | 84 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); |
84 }; | 85 }; |
85 | 86 |
86 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ |
OLD | NEW |