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

Side by Side Diff: chrome/browser/resources/network_menu.js

Issue 3678006: Implement action interface in network_menu.js for 'connect'. (Closed)
Patch Set: Set status for non connected networks. Created 10 years, 2 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 * Sends 'activate' DOMUI message. 6 * Sends "connect" using the 'action' DOMUI message.
7 */ 7 */
8 function sendAction(values) { 8 function sendConnect(index, passphrase, identity) {
9 chrome.send('action', values); 9 chrome.send('action', [ 'connect', String(index), passphrase, identity ]);
10 } 10 }
11 11
12 var NetworkMenuItem = cr.ui.define('div'); 12 var NetworkMenuItem = cr.ui.define('div');
13 13
14 NetworkMenuItem.prototype = { 14 NetworkMenuItem.prototype = {
15 __proto__: MenuItem.prototype, 15 __proto__: MenuItem.prototype,
16 16
17 /** 17 /**
18 * Internal method to initiailze the MenuItem. 18 * Internal method to initiailze the MenuItem.
19 * @private 19 * @private
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 NetworkMenu.prototype = { 67 NetworkMenu.prototype = {
68 __proto__: Menu.prototype, 68 __proto__: Menu.prototype,
69 69
70 createMenuItem: function(attrs) { 70 createMenuItem: function(attrs) {
71 if (attrs.type == 'command') { 71 if (attrs.type == 'command') {
72 return new NetworkMenuItem(); 72 return new NetworkMenuItem();
73 } else { 73 } else {
74 return new MenuItem(); 74 return new MenuItem();
75 } 75 }
76 }, 76 },
77
78 onKeydown_: function(event) {
79 switch (event.keyIdentifier) {
80 case 'Enter':
81 case 'U+0020': // space
82 // Temporary, for testing sendConnect()
83 sendConnect(this.getMenuItemIndexOf(this.current_),
84 "passphrase", "identity");
85 break;
86 default:
87 Menu.prototype.onKeydown_.call(this, event);
88 break;
89 }
90 }
77 }; 91 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698