Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js

Issue 2093753002: Reland: Make ChromeVox Next a setting in options page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ChromeVox panel and menus. 6 * @fileoverview The ChromeVox panel and menus.
7 */ 7 */
8 8
9 goog.provide('Panel'); 9 goog.provide('Panel');
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // Insert items from the bindings into the menus. 289 // Insert items from the bindings into the menus.
290 sortedBindings.forEach(goog.bind(function(binding) { 290 sortedBindings.forEach(goog.bind(function(binding) {
291 var category = cvox.CommandStore.categoryForCommand(binding.command); 291 var category = cvox.CommandStore.categoryForCommand(binding.command);
292 var menu = category ? categoryToMenu[category] : null; 292 var menu = category ? categoryToMenu[category] : null;
293 if (binding.title && menu) { 293 if (binding.title && menu) {
294 menu.addMenuItem( 294 menu.addMenuItem(
295 binding.title, 295 binding.title,
296 binding.keySeq, 296 binding.keySeq,
297 function() { 297 function() {
298 var bkgnd = 298 var bkgnd =
299 chrome.extension.getBackgroundPage()['global']['backgroundObj']; 299 chrome.extension.
300 getBackgroundPage()['ChromeVoxState']['instance'];
300 bkgnd['onGotCommand'](binding.command); 301 bkgnd['onGotCommand'](binding.command);
301 }); 302 });
302 } 303 }
303 }, this)); 304 }, this));
304 305
305 // Add all open tabs to the Tabs menu. 306 // Add all open tabs to the Tabs menu.
306 bkgnd.chrome.windows.getLastFocused(function(lastFocusedWindow) { 307 bkgnd.chrome.windows.getLastFocused(function(lastFocusedWindow) {
307 bkgnd.chrome.windows.getAll({'populate': true}, function(windows) { 308 bkgnd.chrome.windows.getAll({'populate': true}, function(windows) {
308 for (var i = 0; i < windows.length; i++) { 309 for (var i = 0; i < windows.length; i++) {
309 var tabs = windows[i].tabs; 310 var tabs = windows[i].tabs;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 Panel.searchInput_.value = ''; 538 Panel.searchInput_.value = '';
538 } 539 }
539 } 540 }
540 }; 541 };
541 542
542 /** 543 /**
543 * Open the ChromeVox Options. 544 * Open the ChromeVox Options.
544 */ 545 */
545 Panel.onOptions = function() { 546 Panel.onOptions = function() {
546 var bkgnd = 547 var bkgnd =
547 chrome.extension.getBackgroundPage()['global']['backgroundObj']; 548 chrome.extension.getBackgroundPage()['ChromeVoxState']['instance'];
548 bkgnd['showOptionsPage'](); 549 bkgnd['showOptionsPage']();
549 window.location = '#'; 550 window.location = '#';
550 }; 551 };
551 552
552 /** 553 /**
553 * Exit ChromeVox. 554 * Exit ChromeVox.
554 */ 555 */
555 Panel.onClose = function() { 556 Panel.onClose = function() {
556 window.location = '#close'; 557 window.location = '#close';
557 }; 558 };
(...skipping 10 matching lines...) Expand all
568 569
569 /** 570 /**
570 * Close the menus and restore focus to the page. If a menu item's callback 571 * Close the menus and restore focus to the page. If a menu item's callback
571 * was queued, execute it once focus is restored. 572 * was queued, execute it once focus is restored.
572 */ 573 */
573 Panel.closeMenusAndRestoreFocus = function() { 574 Panel.closeMenusAndRestoreFocus = function() {
574 // Make sure we're not in full-screen mode. 575 // Make sure we're not in full-screen mode.
575 window.location = '#'; 576 window.location = '#';
576 577
577 var bkgnd = 578 var bkgnd =
578 chrome.extension.getBackgroundPage()['global']['backgroundObj']; 579 chrome.extension.getBackgroundPage()['ChromeVoxState']['instance'];
579 bkgnd['endExcursion'](Panel.pendingCallback_); 580 bkgnd['endExcursion'](Panel.pendingCallback_);
580 }; 581 };
581 582
582 window.addEventListener('load', function() { 583 window.addEventListener('load', function() {
583 Panel.init(); 584 Panel.init();
584 }, false); 585 }, false);
585 586
586 window.addEventListener('hashchange', function() { 587 window.addEventListener('hashchange', function() {
587 if (location.hash == '#fullscreen' || location.hash == '#focus') { 588 if (location.hash == '#fullscreen' || location.hash == '#focus') {
588 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; 589 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn;
589 cvox.ChromeVox.isStickyPrefOn = false; 590 cvox.ChromeVox.isStickyPrefOn = false;
590 } else { 591 } else {
591 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; 592 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_;
592 } 593 }
593 }, false); 594 }, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698