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