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_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/webui/sync_setup_handler.h" | 9 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
10 | 10 |
11 class PrefService; | 11 class PrefService; |
12 | 12 |
13 // The handler for JavaScript messages related to the "sync promo" page. | 13 // The handler for JavaScript messages related to the "sync promo" page. |
14 class SyncPromoHandler : public SyncSetupHandler { | 14 class SyncPromoHandler : public SyncSetupHandler { |
15 public: | 15 public: |
16 explicit SyncPromoHandler(const std::string& source, | 16 explicit SyncPromoHandler(const std::string& source, |
17 ProfileManager* profile_manager); | 17 ProfileManager* profile_manager); |
18 virtual ~SyncPromoHandler(); | 18 virtual ~SyncPromoHandler(); |
19 | 19 |
20 // Called to register our preferences before we use them (so there will be a | 20 // Called to register our preferences before we use them (so there will be a |
21 // default if not present yet). | 21 // default if not present yet). |
22 static void RegisterUserPrefs(PrefService* prefs); | 22 static void RegisterUserPrefs(PrefService* prefs); |
23 | 23 |
24 // WebUIMessageHandler implementation. | 24 // WebUIMessageHandler implementation. |
25 virtual void RegisterMessages() OVERRIDE; | 25 virtual void RegisterMessages() OVERRIDE; |
26 | 26 |
27 // SyncSetupFlowHandler implementation. | 27 // SyncSetupFlowHandler implementation. |
28 virtual void ShowGaiaSuccessAndClose() OVERRIDE; | |
29 virtual void ShowGaiaSuccessAndSettingUp() OVERRIDE; | |
30 virtual void ShowConfigure(const base::DictionaryValue& args) OVERRIDE; | 28 virtual void ShowConfigure(const base::DictionaryValue& args) OVERRIDE; |
31 | 29 |
32 // content::NotificationObserver implementation. | 30 // content::NotificationObserver implementation. |
33 virtual void Observe(int type, | 31 virtual void Observe(int type, |
34 const content::NotificationSource& source, | 32 const content::NotificationSource& source, |
35 const content::NotificationDetails& details) OVERRIDE; | 33 const content::NotificationDetails& details) OVERRIDE; |
36 | 34 |
37 protected: | 35 protected: |
38 virtual void StepWizardForShowSetupUI() OVERRIDE; | 36 virtual void ShowSetupUI() OVERRIDE; |
39 | 37 |
40 virtual void ShowSetupUI() OVERRIDE; | 38 virtual void RecordSignin() OVERRIDE; |
41 | 39 |
42 private: | 40 private: |
43 // JavaScript callback handler to close the sync promo. | 41 // JavaScript callback handler to close the sync promo. |
44 void HandleCloseSyncPromo(const base::ListValue* args); | 42 void HandleCloseSyncPromo(const base::ListValue* args); |
45 | 43 |
46 // Gets the sync promo layout for the current sync promo version. | 44 // Gets the sync promo layout for the current sync promo version. |
47 int GetPromoVersion(); | 45 int GetPromoVersion(); |
48 | 46 |
49 // JavaScript callback handler to initialize the sync promo. | 47 // JavaScript callback handler to initialize the sync promo. |
50 void HandleInitializeSyncPromo(const base::ListValue* args); | 48 void HandleInitializeSyncPromo(const base::ListValue* args); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 bool window_already_closed_; | 90 bool window_already_closed_; |
93 | 91 |
94 // Extra UMA histogram name to log stats to, based on the source for showing | 92 // Extra UMA histogram name to log stats to, based on the source for showing |
95 // the sync promo page. | 93 // the sync promo page. |
96 std::string histogram_name_; | 94 std::string histogram_name_; |
97 | 95 |
98 DISALLOW_COPY_AND_ASSIGN(SyncPromoHandler); | 96 DISALLOW_COPY_AND_ASSIGN(SyncPromoHandler); |
99 }; | 97 }; |
100 | 98 |
101 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ | 99 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ |
OLD | NEW |