| 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_NTP_ANDROID_PROMO_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_PROMO_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_PROMO_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_PROMO_HANDLER_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/notification_observer.h" | 8 #include "content/public/browser/notification_observer.h" |
| 9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class PromoHandler : public content::WebUIMessageHandler, | 22 class PromoHandler : public content::WebUIMessageHandler, |
| 23 public content::NotificationObserver { | 23 public content::NotificationObserver { |
| 24 public: | 24 public: |
| 25 PromoHandler(); | 25 PromoHandler(); |
| 26 virtual ~PromoHandler(); | 26 virtual ~PromoHandler(); |
| 27 | 27 |
| 28 // WebUIMessageHandler implementation. | 28 // WebUIMessageHandler implementation. |
| 29 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
| 30 | 30 |
| 31 // Register preferences. | 31 // Register preferences. |
| 32 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 32 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // NotificationObserver override and implementation. | 35 // NotificationObserver override and implementation. |
| 36 virtual void Observe(int type, | 36 virtual void Observe(int type, |
| 37 const content::NotificationSource& source, | 37 const content::NotificationSource& source, |
| 38 const content::NotificationDetails& details) OVERRIDE; | 38 const content::NotificationDetails& details) OVERRIDE; |
| 39 | 39 |
| 40 // Callback for the "promoSendEmail" message. | 40 // Callback for the "promoSendEmail" message. |
| 41 // |args| is a list [ subject, body, app-chooser-message ]. | 41 // |args| is a list [ subject, body, app-chooser-message ]. |
| 42 void HandlePromoSendEmail(const base::ListValue* args); | 42 void HandlePromoSendEmail(const base::ListValue* args); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Updates the profile preference if any desktop session was discovered. | 75 // Updates the profile preference if any desktop session was discovered. |
| 76 void CheckDesktopSessions(); | 76 void CheckDesktopSessions(); |
| 77 | 77 |
| 78 // Registrar to receive notification on promo changes. | 78 // Registrar to receive notification on promo changes. |
| 79 content::NotificationRegistrar registrar_; | 79 content::NotificationRegistrar registrar_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(PromoHandler); | 81 DISALLOW_COPY_AND_ASSIGN(PromoHandler); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_PROMO_HANDLER_H_ | 84 #endif // CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_PROMO_HANDLER_H_ |
| OLD | NEW |