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 | 7 |
8 #include "chrome/browser/ui/webui/sync_setup_handler.h" | 8 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
9 | 9 |
10 class PrefService; | 10 class PrefService; |
| 11 |
| 12 namespace user_prefs { |
11 class PrefRegistrySyncable; | 13 class PrefRegistrySyncable; |
| 14 } |
12 | 15 |
13 // The handler for JavaScript messages related to the "sync promo" page. | 16 // The handler for JavaScript messages related to the "sync promo" page. |
14 class SyncPromoHandler : public SyncSetupHandler { | 17 class SyncPromoHandler : public SyncSetupHandler { |
15 public: | 18 public: |
16 explicit SyncPromoHandler(ProfileManager* profile_manager); | 19 explicit SyncPromoHandler(ProfileManager* profile_manager); |
17 virtual ~SyncPromoHandler(); | 20 virtual ~SyncPromoHandler(); |
18 | 21 |
19 // Called to register our preferences before we use them (so there will be a | 22 // Called to register our preferences before we use them (so there will be a |
20 // default if not present yet). | 23 // default if not present yet). |
21 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 24 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
22 | 25 |
23 // WebUIMessageHandler implementation. | 26 // WebUIMessageHandler implementation. |
24 virtual void RegisterMessages() OVERRIDE; | 27 virtual void RegisterMessages() OVERRIDE; |
25 | 28 |
26 // Overridden to skip sync settings dialog if user wants to use default | 29 // Overridden to skip sync settings dialog if user wants to use default |
27 // settings. |show_advanced| is ignored because we never want to display the | 30 // settings. |show_advanced| is ignored because we never want to display the |
28 // "Sync Everything" dialog for the sync promo. | 31 // "Sync Everything" dialog for the sync promo. |
29 virtual void DisplayConfigureSync(bool show_advanced, | 32 virtual void DisplayConfigureSync(bool show_advanced, |
30 bool passphrase_failed) OVERRIDE; | 33 bool passphrase_failed) OVERRIDE; |
31 | 34 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 91 |
89 // If the user closes the whole window we'll get a close notification from the | 92 // If the user closes the whole window we'll get a close notification from the |
90 // tab as well, so this bool acts as a small mutex to only report the close | 93 // tab as well, so this bool acts as a small mutex to only report the close |
91 // method once. | 94 // method once. |
92 bool window_already_closed_; | 95 bool window_already_closed_; |
93 | 96 |
94 DISALLOW_COPY_AND_ASSIGN(SyncPromoHandler); | 97 DISALLOW_COPY_AND_ASSIGN(SyncPromoHandler); |
95 }; | 98 }; |
96 | 99 |
97 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ | 100 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_HANDLER_H_ |
OLD | NEW |