| OLD | NEW |
| 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 // 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(); |
| 17 |
| 16 /** | 18 /** |
| 17 * Sends 'activate' DOMUI message. | 19 * Sends 'activate' DOMUI message. |
| 18 * @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. |
| 19 * @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 |
| 20 * 'activate_no_close'. | 22 * 'activate_no_close'. |
| 21 * 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 |
| 22 * to pass number to C++. | 24 * to pass number to C++. |
| 23 */ | 25 */ |
| 24 function sendActivate(index, mode) { | 26 function sendActivate(index, mode) { |
| 25 chrome.send('activate', [String(index), mode]); | 27 chrome.send('activate', [String(index), mode]); |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 document.getElementById('viewport').updateModel(model); | 665 document.getElementById('viewport').updateModel(model); |
| 664 } | 666 } |
| 665 | 667 |
| 666 function modelUpdated() { | 668 function modelUpdated() { |
| 667 chrome.send('model_updated', []); | 669 chrome.send('model_updated', []); |
| 668 } | 670 } |
| 669 | 671 |
| 670 function enableScroll(enabled) { | 672 function enableScroll(enabled) { |
| 671 document.getElementById('viewport').scrollEnabled = enabled; | 673 document.getElementById('viewport').scrollEnabled = enabled; |
| 672 } | 674 } |
| OLD | NEW |