| 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. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Add error processing to API calls. | 122 // Add error processing to API calls. |
| 123 tasks.instrumentApiFunction(chrome.location.onLocationUpdate, 'addListener', 0); | 123 tasks.instrumentApiFunction(chrome.location.onLocationUpdate, 'addListener', 0); |
| 124 tasks.instrumentApiFunction(chrome.notifications, 'create', 2); | 124 tasks.instrumentApiFunction(chrome.notifications, 'create', 2); |
| 125 tasks.instrumentApiFunction(chrome.notifications, 'update', 2); | 125 tasks.instrumentApiFunction(chrome.notifications, 'update', 2); |
| 126 tasks.instrumentApiFunction(chrome.notifications, 'getAll', 0); | 126 tasks.instrumentApiFunction(chrome.notifications, 'getAll', 0); |
| 127 tasks.instrumentApiFunction( | 127 tasks.instrumentApiFunction( |
| 128 chrome.notifications.onButtonClicked, 'addListener', 0); | 128 chrome.notifications.onButtonClicked, 'addListener', 0); |
| 129 tasks.instrumentApiFunction(chrome.notifications.onClicked, 'addListener', 0); | 129 tasks.instrumentApiFunction(chrome.notifications.onClicked, 'addListener', 0); |
| 130 tasks.instrumentApiFunction(chrome.notifications.onClosed, 'addListener', 0); | 130 tasks.instrumentApiFunction(chrome.notifications.onClosed, 'addListener', 0); |
| 131 tasks.instrumentApiFunction( | 131 tasks.instrumentApiFunction( |
| 132 googleGeolocationAccessEnabledPref, |
| 133 'get', |
| 134 1); |
| 135 tasks.instrumentApiFunction( |
| 132 googleGeolocationAccessEnabledPref.onChange, | 136 googleGeolocationAccessEnabledPref.onChange, |
| 133 'addListener', | 137 'addListener', |
| 134 0); | 138 0); |
| 135 tasks.instrumentApiFunction(chrome.runtime.onInstalled, 'addListener', 0); | 139 tasks.instrumentApiFunction(chrome.runtime.onInstalled, 'addListener', 0); |
| 136 tasks.instrumentApiFunction(chrome.runtime.onStartup, 'addListener', 0); | 140 tasks.instrumentApiFunction(chrome.runtime.onStartup, 'addListener', 0); |
| 137 tasks.instrumentApiFunction(chrome.tabs, 'create', 1); | 141 tasks.instrumentApiFunction(chrome.tabs, 'create', 1); |
| 138 tasks.instrumentApiFunction(storage, 'get', 1); | 142 tasks.instrumentApiFunction(storage, 'get', 1); |
| 139 | 143 |
| 140 var updateCardsAttempts = buildAttemptManager( | 144 var updateCardsAttempts = buildAttemptManager( |
| 141 'cards-update', | 145 'cards-update', |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 | 896 |
| 893 chrome.location.onLocationUpdate.addListener(function(position) { | 897 chrome.location.onLocationUpdate.addListener(function(position) { |
| 894 recordEvent(GoogleNowEvent.LOCATION_UPDATE); | 898 recordEvent(GoogleNowEvent.LOCATION_UPDATE); |
| 895 updateNotificationsCards(position); | 899 updateNotificationsCards(position); |
| 896 }); | 900 }); |
| 897 | 901 |
| 898 chrome.omnibox.onInputEntered.addListener(function(text) { | 902 chrome.omnibox.onInputEntered.addListener(function(text) { |
| 899 localStorage['server_url'] = NOTIFICATION_CARDS_URL = text; | 903 localStorage['server_url'] = NOTIFICATION_CARDS_URL = text; |
| 900 initialize(); | 904 initialize(); |
| 901 }); | 905 }); |
| OLD | NEW |