OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_WEB_RESOURCE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
6 #define CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Unpack the web resource as a custom promo signal. Expects a start and end | 59 // Unpack the web resource as a custom promo signal. Expects a start and end |
60 // signal, with the promo to be shown in the tooltip of the start signal | 60 // signal, with the promo to be shown in the tooltip of the start signal |
61 // field. Delivery will be in json in the form of: | 61 // field. Delivery will be in json in the form of: |
62 // { | 62 // { |
63 // "topic": { | 63 // "topic": { |
64 // "answers": [ | 64 // "answers": [ |
65 // { | 65 // { |
66 // "answer_id": "1067976", | 66 // "answer_id": "1067976", |
67 // "name": "promo_start", | 67 // "name": "promo_start", |
68 // "question": "", | 68 // "question": "1:24", |
69 // "tooltip": | 69 // "tooltip": |
70 // "Click \u003ca href=http://www.google.com\u003ehere\u003c/a\u003e!", | 70 // "Click \u003ca href=http://www.google.com\u003ehere\u003c/a\u003e!", |
71 // "inproduct": "10/8/09 12:00", | 71 // "inproduct": "10/8/09 12:00", |
72 // "inproduct_target": null | 72 // "inproduct_target": null |
73 // }, | 73 // }, |
74 // { | 74 // { |
75 // "answer_id": "1067976", | 75 // "answer_id": "1067976", |
76 // "name": "promo_end", | 76 // "name": "promo_end", |
77 // "question": "", | 77 // "question": "", |
78 // "tooltip": "", | 78 // "tooltip": "", |
79 // "inproduct": "10/8/11 12:00", | 79 // "inproduct": "10/8/11 12:00", |
80 // "inproduct_target": null | 80 // "inproduct_target": null |
81 // }, | 81 // }, |
82 // ... | 82 // ... |
83 // ] | 83 // ] |
84 // } | 84 // } |
85 // } | 85 // } |
86 // | 86 // |
| 87 // Because the promo signal data is piggybacked onto the tip server, the |
| 88 // values don't exactly correspond with the field names: |
| 89 // |
| 90 // For "promo_start" or "promo_end", the date to start or stop showing the |
| 91 // promotional line is given by the "inproduct" line. |
| 92 // For "promo_start", the promotional line itself is given in the "tooltip" |
| 93 // field. The "question" field gives the type of builds that should be shown |
| 94 // this promo (see the BuildType enum in web_resource_service.cc) and the |
| 95 // number of hours that each promo group should see it, separated by ":". |
| 96 // For example, "7:24" would indicate that all builds should see the promo, |
| 97 // and each group should see it for 24 hours. |
| 98 // |
87 // Public for unit testing. | 99 // Public for unit testing. |
88 void UnpackPromoSignal(const DictionaryValue& parsed_json); | 100 void UnpackPromoSignal(const DictionaryValue& parsed_json); |
89 | 101 |
90 // Unpack the web resource as a custom logo signal. Expects a start and end | 102 // Unpack the web resource as a custom logo signal. Expects a start and end |
91 // signal. Delivery will be in json in the form of: | 103 // signal. Delivery will be in json in the form of: |
92 // { | 104 // { |
93 // "topic": { | 105 // "topic": { |
94 // "answers": [ | 106 // "answers": [ |
95 // { | 107 // { |
96 // "answer_id": "107366", | 108 // "answer_id": "107366", |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 int cache_update_delay_; | 190 int cache_update_delay_; |
179 | 191 |
180 // True if a task has been set to update the cache when a new web resource | 192 // True if a task has been set to update the cache when a new web resource |
181 // becomes available. | 193 // becomes available. |
182 bool web_resource_update_scheduled_; | 194 bool web_resource_update_scheduled_; |
183 | 195 |
184 DISALLOW_COPY_AND_ASSIGN(WebResourceService); | 196 DISALLOW_COPY_AND_ASSIGN(WebResourceService); |
185 }; | 197 }; |
186 | 198 |
187 #endif // CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ | 199 #endif // CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
OLD | NEW |