Switch TestFrameNavigationObserver to DidCommitProvisionalLoadForFrame.
[chromium-blink-merge.git] / third_party / google_input_tools / src / chrome / os / inputview / readystate.js
blob5aeadbbf8bc2ca753e8e4f5b8628f28123ea0f99
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
14 goog.provide('i18n.input.chrome.inputview.ReadyState');
18 goog.scope(function() {
22 /**
23 * The system ready state which mainains a state bit map.
24 * Inputview controller uses this to determine whether the system is ready to
25 * render the UI.
27 * @constructor
29 i18n.input.chrome.inputview.ReadyState = function() {
31 var ReadyState = i18n.input.chrome.inputview.ReadyState;
34 /**
35 * The state type.
37 * @enum {number}
39 ReadyState.StateType = {
40 IME_LIST_READY: 0x1,
41 KEYBOARD_CONFIG_READY: 0x10,
42 LAYOUT_READY: 0x100,
43 LAYOUT_CONFIG_READY: 0x1000,
44 M17N_LAYOUT_READY: 0x10000,
45 INPUT_METHOD_CONFIG_READY: 0x100000
49 /**
50 * The internal ready state bit map.
52 * @private {number}
54 ReadyState.prototype.state_ = 0;
57 /**
58 * Gets whether the system is ready.
60 * @return {boolean} Whether the system is ready.
62 ReadyState.prototype.isAllReady = function() {
63 return !!(this.state_ & (
64 ReadyState.StateType.IME_LIST_READY |
65 ReadyState.StateType.KEYBOARD_CONFIG_READY |
66 ReadyState.StateType.LAYOUT_READY |
67 ReadyState.StateType.LAYOUT_CONFIG_READY |
68 ReadyState.StateType.M17N_LAYOUT_READY));
72 /**
73 * Gets whether a specific state type is ready.
75 * @param {ReadyState.StateType} stateType .
76 * @return {boolean} Whether is ready.
78 ReadyState.prototype.isReady = function(stateType) {
79 return !!(this.state_ & stateType);
83 /**
84 * Sets state ready for the given state type.
86 * @param {ReadyState.StateType} stateType .
88 ReadyState.prototype.markStateReady = function(stateType) {
89 this.state_ |= stateType;
91 }); // goog.scope