| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 var connection; | 4 var connection; |
| 5 var mojo_api; | 5 var mojo_api; |
| 6 var input_focused_event; | 6 var input_focused_event; |
| 7 | 7 |
| 8 if (!chrome.virtualKeyboardPrivate) { | 8 if (!chrome.virtualKeyboardPrivate) { |
| 9 define('main', [ | 9 define('main', [ |
| 10 'mojo/public/js/connection', | 10 'mojo/public/js/connection', |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return; | 53 return; |
| 54 mojo_api.keyboard_.hideKeyboard(); | 54 mojo_api.keyboard_.hideKeyboard(); |
| 55 }; | 55 }; |
| 56 chrome.virtualKeyboardPrivate.moveCursor = function() {}; | 56 chrome.virtualKeyboardPrivate.moveCursor = function() {}; |
| 57 chrome.virtualKeyboardPrivate.lockKeyboard = function() {}; | 57 chrome.virtualKeyboardPrivate.lockKeyboard = function() {}; |
| 58 chrome.virtualKeyboardPrivate.keyboardLoaded = function() {}; | 58 chrome.virtualKeyboardPrivate.keyboardLoaded = function() {}; |
| 59 chrome.virtualKeyboardPrivate.getKeyboardConfig = function(callback) { | 59 chrome.virtualKeyboardPrivate.getKeyboardConfig = function(callback) { |
| 60 callback({ | 60 callback({ |
| 61 layout: 'qwerty', | 61 layout: 'qwerty', |
| 62 a11ymode: false, | 62 a11ymode: false, |
| 63 experimental: false | 63 experimental: false, |
| 64 gesturetyping: false |
| 64 }); | 65 }); |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 function BrowserEvent() { | 68 function BrowserEvent() { |
| 68 this.listeners_ = []; | 69 this.listeners_ = []; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 BrowserEvent.prototype.addListener = function(callback) { | 72 BrowserEvent.prototype.addListener = function(callback) { |
| 72 this.listeners_.push(callback); | 73 this.listeners_.push(callback); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 BrowserEvent.prototype.forEach = function(callback) { | 76 BrowserEvent.prototype.forEach = function(callback) { |
| 76 for (var i = 0; i < this.listeners_.length; ++i) | 77 for (var i = 0; i < this.listeners_.length; ++i) |
| 77 callback(this.listeners_[i]); | 78 callback(this.listeners_[i]); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 input_focused_event = new BrowserEvent; | 81 input_focused_event = new BrowserEvent; |
| 81 chrome.virtualKeyboardPrivate.onTextInputBoxFocused = input_focused_event; | 82 chrome.virtualKeyboardPrivate.onTextInputBoxFocused = input_focused_event; |
| 82 } | 83 } |
| OLD | NEW |