| 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_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_H_ |
| 6 #define CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 bool new_notification() const { return new_notification_; } | 60 bool new_notification() const { return new_notification_; } |
| 61 | 61 |
| 62 const std::string& promo_text() const { return promo_text_; } | 62 const std::string& promo_text() const { return promo_text_; } |
| 63 PromoType promo_type() const { return promo_type_; } | 63 PromoType promo_type() const { return promo_type_; } |
| 64 const base::DictionaryValue* promo_payload() const { | 64 const base::DictionaryValue* promo_payload() const { |
| 65 return promo_payload_.get(); | 65 return promo_payload_.get(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Register preferences. | 68 // Register preferences. |
| 69 static void RegisterPrefs(PrefRegistrySimple* registry); | 69 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 70 static void RegisterUserPrefs(PrefService* prefs, | 70 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 71 PrefRegistrySyncable* registry); | 71 static void MigrateUserPrefs(PrefService* user_prefs); |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 // For testing. | 74 // For testing. |
| 75 friend class NotificationPromoTest; | 75 friend class NotificationPromoTest; |
| 76 | 76 |
| 77 // Check if this promo notification is new based on start/end times, | 77 // Check if this promo notification is new based on start/end times, |
| 78 // and trigger events accordingly. | 78 // and trigger events accordingly. |
| 79 void CheckForNewNotification(); | 79 void CheckForNewNotification(); |
| 80 | 80 |
| 81 // Actions on receiving a new promo notification. | 81 // Actions on receiving a new promo notification. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 int group_; | 115 int group_; |
| 116 int views_; | 116 int views_; |
| 117 bool closed_; | 117 bool closed_; |
| 118 | 118 |
| 119 bool new_notification_; | 119 bool new_notification_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(NotificationPromo); | 121 DISALLOW_COPY_AND_ASSIGN(NotificationPromo); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 #endif // CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_H_ | 124 #endif // CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_H_ |
| OLD | NEW |