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

Unified Diff: chrome/browser/resources/chromeos/login/apps_menu.js

Issue 2001403003: kiosk: Fix AppsMenu.findAndRunAppForTesting js error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/apps_menu.js
diff --git a/chrome/browser/resources/chromeos/login/apps_menu.js b/chrome/browser/resources/chromeos/login/apps_menu.js
index d60dce3dce4ba1ffc2b633768c1316cc6aeee4f0..d16032c0be47f3dc20b261cc621de0bf18a367da 100644
--- a/chrome/browser/resources/chromeos/login/apps_menu.js
+++ b/chrome/browser/resources/chromeos/login/apps_menu.js
@@ -76,22 +76,9 @@ cr.define('login', function() {
},
findAndRunAppForTesting: function(id, opt_diagnostic_mode) {
- this.showMenu(true);
- for (var i = 0; i < this.menu.menuItems.length; i++) {
- var menuNode = this.menu.menuItems[i];
- if (menuNode.appId == id) {
- var activationEvent = cr.doc.createEvent('Event');
- activationEvent.initEvent('activate', true, true);
-
- if (opt_diagnostic_mode) {
- var fakeCtrlEnterEvent = cr.doc.createEvent('KeyboardEvent');
- fakeCtrlEnterEvent.initKeyboardEvent('keypress', true, true, null,
- 'Enter', 0,
- true, false, false, false);
- activationEvent.originalEvent = fakeCtrlEnterEvent;
- }
-
- menuNode.dispatchEvent(activationEvent);
+ for (var i = 0; i < this.data.length; i++) {
+ if (this.data[i].id == id) {
+ this.launchApp_(this.data[i], !!opt_diagnostic_mode);
break;
}
}
@@ -134,7 +121,6 @@ cr.define('login', function() {
addItem_: function(app) {
var menuItem = this.menu.addMenuItem(app);
menuItem.classList.add('apps-menu-item');
- menuItem.appId = app.id;
menuItem.addEventListener('activate', function(e) {
var diagnosticMode = e.originalEvent && e.originalEvent.ctrlKey;
this.launchApp_(app, diagnosticMode);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698