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_PROMO_RESOURCE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_PROMO_RESOURCE_SERVICE_H_ |
6 #define CHROME_BROWSER_WEB_RESOURCE_PROMO_RESOURCE_SERVICE_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_PROMO_RESOURCE_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/web_resource/notification_promo.h" | 11 #include "chrome/browser/web_resource/notification_promo.h" |
12 #include "chrome/browser/web_resource/web_resource_service.h" | 12 #include "chrome/browser/web_resource/web_resource_service.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 } | 16 } |
17 | 17 |
18 class PrefService; | 18 class PrefService; |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 // A PromoResourceService fetches data from a web resource server to be used to | 21 // A PromoResourceService fetches data from a web resource server to be used to |
22 // dynamically change the appearance of the New Tab Page. For example, it has | 22 // dynamically change the appearance of the New Tab Page. For example, it has |
23 // been used to fetch "tips" to be displayed on the NTP, or to display | 23 // been used to fetch "tips" to be displayed on the NTP, or to display |
24 // promotional messages to certain groups of Chrome users. | 24 // promotional messages to certain groups of Chrome users. |
25 class PromoResourceService : public WebResourceService { | 25 class PromoResourceService : public WebResourceService { |
26 public: | 26 public: |
27 // Checks for conditions to show promo. | |
28 static bool CanShowNotificationPromo(Profile* profile); | |
29 | |
30 static void RegisterPrefs(PrefService* local_state); | 27 static void RegisterPrefs(PrefService* local_state); |
31 | 28 |
32 static void RegisterUserPrefs(PrefService* prefs); | 29 static void RegisterUserPrefs(PrefService* prefs); |
33 | 30 |
34 explicit PromoResourceService(Profile* profile); | 31 explicit PromoResourceService(Profile* profile); |
35 | 32 |
36 private: | 33 private: |
37 virtual ~PromoResourceService(); | 34 virtual ~PromoResourceService(); |
38 | 35 |
39 int GetPromoServiceVersion(); | 36 int GetPromoServiceVersion(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // when a new web resource should be shown or removed. | 68 // when a new web resource should be shown or removed. |
72 base::WeakPtrFactory<PromoResourceService> weak_ptr_factory_; | 69 base::WeakPtrFactory<PromoResourceService> weak_ptr_factory_; |
73 | 70 |
74 // Notification type when an update is done. | 71 // Notification type when an update is done. |
75 int notification_type_; | 72 int notification_type_; |
76 | 73 |
77 DISALLOW_COPY_AND_ASSIGN(PromoResourceService); | 74 DISALLOW_COPY_AND_ASSIGN(PromoResourceService); |
78 }; | 75 }; |
79 | 76 |
80 #endif // CHROME_BROWSER_WEB_RESOURCE_PROMO_RESOURCE_SERVICE_H_ | 77 #endif // CHROME_BROWSER_WEB_RESOURCE_PROMO_RESOURCE_SERVICE_H_ |
OLD | NEW |