| OLD | NEW |
| 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
| 2 // limitations under the License. | 2 // limitations under the License. |
| 3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
| 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
| 6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
| 7 // | 7 // |
| 8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 // | 9 // |
| 10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 i18n.input.chrome.inputview.ReadyState = function() { | 29 i18n.input.chrome.inputview.ReadyState = function() { |
| 30 }; | 30 }; |
| 31 var ReadyState = i18n.input.chrome.inputview.ReadyState; | 31 var ReadyState = i18n.input.chrome.inputview.ReadyState; |
| 32 | 32 |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * The state type. | 35 * The state type. |
| 36 * | 36 * |
| 37 * @enum {number} | 37 * @enum {number} |
| 38 */ | 38 */ |
| 39 ReadyState.StateType = { | 39 ReadyState.State = { |
| 40 IME_LIST_READY: 0x1, | 40 IME_LIST_READY: 0x1, |
| 41 KEYBOARD_CONFIG_READY: 0x10, | 41 KEYBOARD_CONFIG_READY: 0x10, |
| 42 LAYOUT_READY: 0x100, | 42 LAYOUT_READY: 0x100, |
| 43 LAYOUT_CONFIG_READY: 0x1000, | 43 LAYOUT_CONFIG_READY: 0x1000, |
| 44 M17N_LAYOUT_READY: 0x10000, | 44 M17N_LAYOUT_READY: 0x10000 |
| 45 INPUT_METHOD_CONFIG_READY: 0x100000 | |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 | 47 |
| 49 /** | 48 /** |
| 50 * The internal ready state bit map. | 49 * The internal ready state bit map. |
| 51 * | 50 * |
| 52 * @private {number} | 51 * @private {number} |
| 53 */ | 52 */ |
| 54 ReadyState.prototype.state_ = 0; | 53 ReadyState.prototype.state_ = 0; |
| 55 | 54 |
| 56 | 55 |
| 57 /** | 56 /** |
| 58 * Gets whether the system is ready. | 57 * Gets whether the system is ready. |
| 59 * | 58 * |
| 60 * @return {boolean} Whether the system is ready. | 59 * @return {boolean} Whether the system is ready. |
| 61 */ | 60 */ |
| 62 ReadyState.prototype.isAllReady = function() { | 61 ReadyState.prototype.isAllReady = function() { |
| 63 return !!(this.state_ & ( | 62 return !!(this.state_ & ( |
| 64 ReadyState.StateType.IME_LIST_READY | | 63 ReadyState.State.IME_LIST_READY | |
| 65 ReadyState.StateType.KEYBOARD_CONFIG_READY | | 64 ReadyState.State.KEYBOARD_CONFIG_READY | |
| 66 ReadyState.StateType.LAYOUT_READY | | 65 ReadyState.State.LAYOUT_READY | |
| 67 ReadyState.StateType.LAYOUT_CONFIG_READY | | 66 ReadyState.State.LAYOUT_CONFIG_READY | |
| 68 ReadyState.StateType.M17N_LAYOUT_READY)); | 67 ReadyState.State.M17N_LAYOUT_READY)); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 | 70 |
| 72 /** | 71 /** |
| 73 * Gets whether a specific state type is ready. | 72 * Gets whether a specific state type is ready. |
| 74 * | 73 * |
| 75 * @param {ReadyState.StateType} stateType . | 74 * @param {ReadyState.State} state . |
| 76 * @return {boolean} Whether is ready. | 75 * @return {boolean} Whether is ready. |
| 77 */ | 76 */ |
| 78 ReadyState.prototype.isReady = function(stateType) { | 77 ReadyState.prototype.isReady = function(state) { |
| 79 return !!(this.state_ & stateType); | 78 return !!(this.state_ & state); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 | 81 |
| 83 /** | 82 /** |
| 84 * Sets state ready for the given state type. | 83 * Sets state ready for the given state type. |
| 85 * | 84 * |
| 86 * @param {ReadyState.StateType} stateType . | 85 * @param {ReadyState.State} state . |
| 87 */ | 86 */ |
| 88 ReadyState.prototype.markStateReady = function(stateType) { | 87 ReadyState.prototype.markStateReady = function(state) { |
| 89 this.state_ |= stateType; | 88 this.state_ |= state; |
| 90 }; | 89 }; |
| 91 }); // goog.scope | 90 }); // goog.scope |
| OLD | NEW |