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