| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 /** | 5 /** |
| 6 * @fileoverview The entry point for all ChromeVox2 related code for the | 6 * @fileoverview The entry point for all ChromeVox2 related code for the |
| 7 * background page. | 7 * background page. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('Background'); | 10 goog.provide('Background'); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 400 |
| 401 // These commands don't require a current range and work in all modes. | 401 // These commands don't require a current range and work in all modes. |
| 402 switch (command) { | 402 switch (command) { |
| 403 case 'toggleChromeVoxVersion': | 403 case 'toggleChromeVoxVersion': |
| 404 if (!this.toggleNext()) | 404 if (!this.toggleNext()) |
| 405 return false; | 405 return false; |
| 406 if (this.currentRange_) | 406 if (this.currentRange_) |
| 407 this.navigateToRange(this.currentRange_); | 407 this.navigateToRange(this.currentRange_); |
| 408 break; | 408 break; |
| 409 case 'showNextUpdatePage': | 409 case 'showNextUpdatePage': |
| 410 var nextUpdatePage = {url: 'cvox2/background/next_update.html'}; | 410 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); |
| 411 chrome.tabs.create(nextUpdatePage); | |
| 412 return false; | 411 return false; |
| 413 default: | 412 default: |
| 414 break; | 413 break; |
| 415 } | 414 } |
| 416 | 415 |
| 417 // Require a current range. | 416 // Require a current range. |
| 418 if (!this.currentRange_) | 417 if (!this.currentRange_) |
| 419 return true; | 418 return true; |
| 420 | 419 |
| 421 // Next/compat commands hereafter. | 420 // Next/compat commands hereafter. |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 return new RegExp('^(' + globs.map(function(glob) { | 1229 return new RegExp('^(' + globs.map(function(glob) { |
| 1231 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 1230 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 1232 .replace(/\*/g, '.*') | 1231 .replace(/\*/g, '.*') |
| 1233 .replace(/\?/g, '.'); | 1232 .replace(/\?/g, '.'); |
| 1234 }).join('|') + ')$'); | 1233 }).join('|') + ')$'); |
| 1235 }; | 1234 }; |
| 1236 | 1235 |
| 1237 new Background(); | 1236 new Background(); |
| 1238 | 1237 |
| 1239 }); // goog.scope | 1238 }); // goog.scope |
| OLD | NEW |