| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @fileoverview The event page for Google Now for Chrome implementation. | 8 * @fileoverview The event page for Google Now for Chrome implementation. |
| 9 * The Google Now event page gets Google Now cards from the server and shows | 9 * The Google Now event page gets Google Now cards from the server and shows |
| 10 * them as Chrome notifications. | 10 * them as Chrome notifications. |
| 11 * The service performs periodic updating of Google Now cards. | 11 * The service performs periodic updating of Google Now cards. |
| 12 * Each updating of the cards includes 4 steps: | 12 * Each updating of the cards includes 4 steps: |
| 13 * 1. Obtaining the location of the machine; | 13 * 1. Obtaining the location of the machine; |
| 14 * 2. Processing requests for cards dismissals that are not yet sent to the | 14 * 2. Processing requests for cards dismissals that are not yet sent to the |
| 15 * server; | 15 * server; |
| 16 * 3. Making a server request based on that location; | 16 * 3. Making a server request based on that location; |
| 17 * 4. Showing the received cards as notifications. | 17 * 4. Showing the received cards as notifications. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 // TODO(vadimt): Decide what to do in incognito mode. | 20 // TODO(vadimt): Decide what to do in incognito mode. |
| 21 // TODO(vadimt): Figure out the final values of the constants. | 21 // TODO(vadimt): Figure out the final values of the constants. |
| 22 // TODO(vadimt): Remove 'console' calls. | |
| 23 | 22 |
| 24 /** | 23 /** |
| 25 * Standard response code for successful HTTP requests. This is the only success | 24 * Standard response code for successful HTTP requests. This is the only success |
| 26 * code the server will send. | 25 * code the server will send. |
| 27 */ | 26 */ |
| 28 var HTTP_OK = 200; | 27 var HTTP_OK = 200; |
| 29 var HTTP_NOCONTENT = 204; | 28 var HTTP_NOCONTENT = 204; |
| 30 | 29 |
| 31 var HTTP_BAD_REQUEST = 400; | 30 var HTTP_BAD_REQUEST = 400; |
| 32 var HTTP_UNAUTHORIZED = 401; | 31 var HTTP_UNAUTHORIZED = 401; |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 lastPollNowPayloads: items.lastPollNowPayloads, | 1234 lastPollNowPayloads: items.lastPollNowPayloads, |
| 1236 notificationGroups: items.notificationGroups | 1235 notificationGroups: items.notificationGroups |
| 1237 }); | 1236 }); |
| 1238 | 1237 |
| 1239 updateNotificationsCards(); | 1238 updateNotificationsCards(); |
| 1240 } | 1239 } |
| 1241 }); | 1240 }); |
| 1242 }); | 1241 }); |
| 1243 } | 1242 } |
| 1244 }); | 1243 }); |
| OLD | NEW |