| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ | 5 #ifndef IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ |
| 6 #define IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ | 6 #define IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Can this promo be shown? | 50 // Can this promo be shown? |
| 51 bool CanShow() const; | 51 bool CanShow() const; |
| 52 | 52 |
| 53 // The time when this promo can start being viewed. | 53 // The time when this promo can start being viewed. |
| 54 double StartTime() const; | 54 double StartTime() const; |
| 55 // The time after which this promo no longer can be viewed. | 55 // The time after which this promo no longer can be viewed. |
| 56 double EndTime() const; | 56 double EndTime() const; |
| 57 | 57 |
| 58 // Mark the promo as closed when the user dismisses it. | 58 // Mark the promo as closed when the user dismisses it. |
| 59 void HandleClosed(); | 59 void HandleClosed(); |
| 60 // Mark the promo has having been viewed. This returns true if views | 60 // Mark the promo has having been viewed. |
| 61 // exceeds the maximum allowed. | 61 void HandleViewed(); |
| 62 bool HandleViewed(); | |
| 63 | 62 |
| 64 const std::string& promo_text() const { return promo_text_; } | 63 const std::string& promo_text() const { return promo_text_; } |
| 65 PromoType promo_type() const { return promo_type_; } | 64 PromoType promo_type() const { return promo_type_; } |
| 66 const base::DictionaryValue* promo_payload() const { | 65 const base::DictionaryValue* promo_payload() const { |
| 67 return promo_payload_.get(); | 66 return promo_payload_.get(); |
| 68 } | 67 } |
| 69 | 68 |
| 70 // Register preferences. | 69 // Register preferences. |
| 71 static void RegisterPrefs(PrefRegistrySimple* registry); | 70 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 72 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 71 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 122 |
| 124 int views_; | 123 int views_; |
| 125 bool closed_; | 124 bool closed_; |
| 126 | 125 |
| 127 DISALLOW_COPY_AND_ASSIGN(NotificationPromo); | 126 DISALLOW_COPY_AND_ASSIGN(NotificationPromo); |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace ios | 129 } // namespace ios |
| 131 | 130 |
| 132 #endif // IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ | 131 #endif // IOS_CHROME_BROWSER_NOTIFICATION_PROMO_H_ |
| OLD | NEW |