| 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_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ |
| 6 #define CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "chrome/browser/web_resource/notification_promo.h" | 11 #include "chrome/browser/web_resource/notification_promo.h" |
| 12 | 12 |
| 13 class Profile; | 13 class PrefServiceSimple; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 class ListValue; | 17 class ListValue; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // Helper class for NotificationPromo that deals with mobile_ntp promos. | 20 // Helper class for NotificationPromo that deals with mobile_ntp promos. |
| 21 class NotificationPromoMobileNtp { | 21 class NotificationPromoMobileNtp { |
| 22 public: | 22 public: |
| 23 explicit NotificationPromoMobileNtp(Profile* profile_); | 23 explicit NotificationPromoMobileNtp(PrefServiceSimple* prefs); |
| 24 ~NotificationPromoMobileNtp(); | 24 ~NotificationPromoMobileNtp(); |
| 25 | 25 |
| 26 // Initialize from prefs/JSON. | 26 // Initialize from prefs/JSON. |
| 27 // Return true if the mobile NTP promotion is valid. | 27 // Return true if the mobile NTP promotion is valid. |
| 28 bool InitFromPrefs(); | 28 bool InitFromPrefs(); |
| 29 bool InitFromJson(const base::DictionaryValue& json); | 29 bool InitFromJson(const base::DictionaryValue& json); |
| 30 | 30 |
| 31 // Return true if the promo is valid and can be shown. | 31 // Return true if the promo is valid and can be shown. |
| 32 bool CanShow() const; | 32 bool CanShow() const; |
| 33 | 33 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const base::ListValue* action_args_; | 82 const base::ListValue* action_args_; |
| 83 // The entire payload for the promo. | 83 // The entire payload for the promo. |
| 84 const base::DictionaryValue* payload_; | 84 const base::DictionaryValue* payload_; |
| 85 // The lower-level notification promo. | 85 // The lower-level notification promo. |
| 86 NotificationPromo notification_promo_; | 86 NotificationPromo notification_promo_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(NotificationPromoMobileNtp); | 88 DISALLOW_COPY_AND_ASSIGN(NotificationPromoMobileNtp); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 #endif // CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ | 91 #endif // CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_ |
| OLD | NEW |