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

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

Issue 6513010: WebUI: Get rid of more references to DOMUI in the rest of the directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // How long to wait to open submenu when mouse hovers. 5 // How long to wait to open submenu when mouse hovers.
6 var SUBMENU_OPEN_DELAY_MS = 200; 6 var SUBMENU_OPEN_DELAY_MS = 200;
7 // How long to wait to close submenu when mouse left. 7 // How long to wait to close submenu when mouse left.
8 var SUBMENU_CLOSE_DELAY_MS = 500; 8 var SUBMENU_CLOSE_DELAY_MS = 500;
9 // Scroll repeat interval. 9 // Scroll repeat interval.
10 var SCROLL_INTERVAL_MS = 20; 10 var SCROLL_INTERVAL_MS = 20;
11 // Scrolling amount in pixel. 11 // Scrolling amount in pixel.
12 var SCROLL_TICK_PX = 4; 12 var SCROLL_TICK_PX = 4;
13 // Regular expression to match/find mnemonic key. 13 // Regular expression to match/find mnemonic key.
14 var MNEMONIC_REGEXP = /([^&]*)&(.)(.*)/; 14 var MNEMONIC_REGEXP = /([^&]*)&(.)(.*)/;
15 15
16 var localStrings = new LocalStrings(); 16 var localStrings = new LocalStrings();
17 17
18 /** 18 /**
19 * Sends 'activate' DOMUI message. 19 * Sends 'activate' WebUI message.
20 * @param {number} index The index of menu item to activate in menu model. 20 * @param {number} index The index of menu item to activate in menu model.
21 * @param {string} mode The activation mode, one of 'close_and_activate', or 21 * @param {string} mode The activation mode, one of 'close_and_activate', or
22 * 'activate_no_close'. 22 * 'activate_no_close'.
23 * TODO(oshima): change these string to enum numbers once it becomes possible 23 * TODO(oshima): change these string to enum numbers once it becomes possible
24 * to pass number to C++. 24 * to pass number to C++.
25 */ 25 */
26 function sendActivate(index, mode) { 26 function sendActivate(index, mode) {
27 chrome.send('activate', [String(index), mode]); 27 chrome.send('activate', [String(index), mode]);
28 } 28 }
29 29
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if (this.attrs.type == 'submenu') { 98 if (this.attrs.type == 'submenu') {
99 this.menu_.openSubmenu(this); 99 this.menu_.openSubmenu(this);
100 } else if (this.attrs.type != 'separator' && 100 } else if (this.attrs.type != 'separator' &&
101 this.className.indexOf('selected') >= 0) { 101 this.className.indexOf('selected') >= 0) {
102 sendActivate(this.menu_.getMenuItemIndexOf(this), 102 sendActivate(this.menu_.getMenuItemIndexOf(this),
103 'close_and_activate'); 103 'close_and_activate');
104 } 104 }
105 }, 105 },
106 106
107 /** 107 /**
108 * Sends open_submenu DOMUI message. 108 * Sends open_submenu WebUI message.
109 */ 109 */
110 sendOpenSubmenuCommand: function() { 110 sendOpenSubmenuCommand: function() {
111 chrome.send('open_submenu', 111 chrome.send('open_submenu',
112 [String(this.menu_.getMenuItemIndexOf(this)), 112 [String(this.menu_.getMenuItemIndexOf(this)),
113 String(this.getBoundingClientRect().top)]); 113 String(this.getBoundingClientRect().top)]);
114 }, 114 },
115 115
116 /** 116 /**
117 * Internal method to initiailze the MenuItem. 117 * Internal method to initiailze the MenuItem.
118 * @private 118 * @private
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 document.getElementById('viewport').updateModel(model); 665 document.getElementById('viewport').updateModel(model);
666 } 666 }
667 667
668 function modelUpdated() { 668 function modelUpdated() {
669 chrome.send('model_updated', []); 669 chrome.send('model_updated', []);
670 } 670 }
671 671
672 function enableScroll(enabled) { 672 function enableScroll(enabled) {
673 document.getElementById('viewport').scrollEnabled = enabled; 673 document.getElementById('viewport').scrollEnabled = enabled;
674 } 674 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/test/render_process_host_browsertest.cc ('k') | chrome/browser/resources/network_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698