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

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

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
index a8ab1644f36f0978390946115d3dd7f7efd11264..565b21fd3098bc5dafe9bcae98ea07f0b43b58cc 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
@@ -130,6 +130,12 @@ Panel.init = function() {
document.addEventListener('keydown', Panel.onKeyDown, false);
document.addEventListener('mouseup', Panel.onMouseUp, false);
+ window.addEventListener('blur', function(evt) {
+ if (evt.target != window || document.activeElement == document.body)
+ return;
+
+ Panel.closeMenusAndRestoreFocus();
+ }, false);
Panel.searchInput_.addEventListener('blur', Panel.onSearchInputBlur, false);
};
@@ -215,6 +221,9 @@ Panel.exec = function(command) {
case PanelCommandType.TUTORIAL:
Panel.onTutorial();
break;
+ case PanelCommandType.UPDATE_NOTES:
+ Panel.onTutorial('updateNotes');
+ break;
}
};
@@ -253,7 +262,7 @@ Panel.setMode = function(mode) {
// host code to make the window fullscreen and give it focus.
window.location = '#fullscreen';
} else if (this.mode_ == Panel.Mode.FOCUSED) {
- // // Change the url fragment to 'focus', which signals the native
+ // Change the url fragment to 'focus', which signals the native
// host code to give the window focus.
window.location = '#focus';
} else {
@@ -784,13 +793,20 @@ Panel.closeMenusAndRestoreFocus = function() {
/**
* Open the tutorial.
+ * @param {string=} opt_page Show a specific page.
*/
-Panel.onTutorial = function() {
+Panel.onTutorial = function(opt_page) {
// Change the url fragment to 'fullscreen', which signals the native
// host code to make the window fullscreen, revealing the menus.
Panel.setMode(Panel.Mode.FULLSCREEN_TUTORIAL);
- Panel.tutorial_.firstPage();
+ switch (opt_page) {
+ case 'updateNotes':
+ Panel.tutorial_.updateNotes();
+ break;
+ default:
+ Panel.tutorial_.lastViewedPage();
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698