| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 This extension manages communications between Chrome, | 8 * @fileoverview This extension manages communications between Chrome, |
| 9 * Google.com pages and the Chrome Hotword extension. | 9 * Google.com pages and the Chrome Hotword extension. |
| 10 * | 10 * |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // More URLs will be added in the future so leaving this as an array. | 169 // More URLs will be added in the future so leaving this as an array. |
| 170 var baseUrls = [ | 170 var baseUrls = [ |
| 171 'chrome://newtab' | 171 'chrome://newtab' |
| 172 ]; | 172 ]; |
| 173 var baseGoogleUrls = [ | 173 var baseGoogleUrls = [ |
| 174 'https://www.google.', | 174 'https://www.google.', |
| 175 'https://encrypted.google.' | 175 'https://encrypted.google.' |
| 176 ]; | 176 ]; |
| 177 var tlds = [ | 177 var tlds = [ |
| 178 'com' | 178 'com', |
| 179 'co.uk', |
| 180 'de', |
| 181 'fr', |
| 182 'ru' |
| 179 ]; | 183 ]; |
| 180 | 184 |
| 181 // Check URLs which do not have locale-based TLDs first. | 185 // Check URLs which do not have locale-based TLDs first. |
| 182 if (this.checkEligibleUrl(url, baseUrls[0])) | 186 if (this.checkEligibleUrl(url, baseUrls[0])) |
| 183 return true; | 187 return true; |
| 184 | 188 |
| 185 // Check URLs with each type of local-based TLD. | 189 // Check URLs with each type of local-based TLD. |
| 186 for (var i = 0; i < baseGoogleUrls.length; i++) { | 190 for (var i = 0; i < baseGoogleUrls.length; i++) { |
| 187 for (var j = 0; j < tlds.length; j++) { | 191 for (var j = 0; j < tlds.length; j++) { |
| 188 var base = baseGoogleUrls[i] + tlds[j]; | 192 var base = baseGoogleUrls[i] + tlds[j]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 201 // TODO(rlp): Possibly remove the next line. It's proably not used, but | 205 // TODO(rlp): Possibly remove the next line. It's proably not used, but |
| 202 // leaving for now to be safe. We should remove it once all messsage | 206 // leaving for now to be safe. We should remove it once all messsage |
| 203 // relaying is removed form the content scripts. | 207 // relaying is removed form the content scripts. |
| 204 chrome.runtime.onMessage.addListener(this.handleMessage_.bind(this)); | 208 chrome.runtime.onMessage.addListener(this.handleMessage_.bind(this)); |
| 205 chrome.runtime.onMessageExternal.addListener( | 209 chrome.runtime.onMessageExternal.addListener( |
| 206 this.handleMessage_.bind(this)); | 210 this.handleMessage_.bind(this)); |
| 207 }; | 211 }; |
| 208 | 212 |
| 209 | 213 |
| 210 new OptInManager().initialize(); | 214 new OptInManager().initialize(); |
| OLD | NEW |