OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_KEYBOARD_KEYBOARD_UTIL_H_ | 5 #ifndef UI_KEYBOARD_KEYBOARD_UTIL_H_ |
6 #define UI_KEYBOARD_KEYBOARD_UTIL_H_ | 6 #define UI_KEYBOARD_KEYBOARD_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 KEYBOARD_CONTROL_MAX, | 38 KEYBOARD_CONTROL_MAX, |
39 }; | 39 }; |
40 | 40 |
41 // An enumeration of keyboard overscroll override value. | 41 // An enumeration of keyboard overscroll override value. |
42 enum KeyboardOverscrolOverride { | 42 enum KeyboardOverscrolOverride { |
43 KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED = 0, | 43 KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED = 0, |
44 KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED, | 44 KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED, |
45 KEYBOARD_OVERSCROLL_OVERRIDE_NONE, | 45 KEYBOARD_OVERSCROLL_OVERRIDE_NONE, |
46 }; | 46 }; |
47 | 47 |
| 48 // An enumeration of keyboard policy settings. |
| 49 enum KeyboardShowOverride { |
| 50 KEYBOARD_SHOW_OVERRIDE_DISABLED = 0, |
| 51 KEYBOARD_SHOW_OVERRIDE_ENABLED, |
| 52 KEYBOARD_SHOW_OVERRIDE_NONE, |
| 53 }; |
| 54 |
48 // Gets the default keyboard bounds from |window_bounds|. | 55 // Gets the default keyboard bounds from |window_bounds|. |
49 KEYBOARD_EXPORT gfx::Rect DefaultKeyboardBoundsFromWindowBounds( | 56 KEYBOARD_EXPORT gfx::Rect DefaultKeyboardBoundsFromWindowBounds( |
50 const gfx::Rect& window_bounds); | 57 const gfx::Rect& window_bounds); |
51 | 58 |
52 // Gets the caculated keyboard bounds from |window_bounds|. The keyboard height | 59 // Gets the caculated keyboard bounds from |window_bounds|. The keyboard height |
53 // is specified by |keyboard_height|. | 60 // is specified by |keyboard_height|. |
54 KEYBOARD_EXPORT gfx::Rect KeyboardBoundsFromWindowBounds( | 61 KEYBOARD_EXPORT gfx::Rect KeyboardBoundsFromWindowBounds( |
55 const gfx::Rect& window_bounds, int keyboard_height); | 62 const gfx::Rect& window_bounds, int keyboard_height); |
56 | 63 |
57 // Sets the state of the a11y onscreen keyboard. | 64 // Sets the state of the a11y onscreen keyboard. |
(...skipping 17 matching lines...) Expand all Loading... |
75 // Returns true if the keyboard usability test is enabled. | 82 // Returns true if the keyboard usability test is enabled. |
76 KEYBOARD_EXPORT bool IsKeyboardUsabilityExperimentEnabled(); | 83 KEYBOARD_EXPORT bool IsKeyboardUsabilityExperimentEnabled(); |
77 | 84 |
78 // Returns true if keyboard overscroll mode is enabled. | 85 // Returns true if keyboard overscroll mode is enabled. |
79 KEYBOARD_EXPORT bool IsKeyboardOverscrollEnabled(); | 86 KEYBOARD_EXPORT bool IsKeyboardOverscrollEnabled(); |
80 | 87 |
81 // Sets temporary keyboard overscroll override. | 88 // Sets temporary keyboard overscroll override. |
82 KEYBOARD_EXPORT void SetKeyboardOverscrollOverride( | 89 KEYBOARD_EXPORT void SetKeyboardOverscrollOverride( |
83 KeyboardOverscrolOverride override); | 90 KeyboardOverscrolOverride override); |
84 | 91 |
| 92 // Sets policy override on whether to show the keyboard. |
| 93 KEYBOARD_EXPORT void SetKeyboardShowOverride(KeyboardShowOverride override); |
| 94 |
85 // Returns true if an IME extension can specify a custom input view for the | 95 // Returns true if an IME extension can specify a custom input view for the |
86 // virtual keyboard window. | 96 // virtual keyboard window. |
87 KEYBOARD_EXPORT bool IsInputViewEnabled(); | 97 KEYBOARD_EXPORT bool IsInputViewEnabled(); |
88 | 98 |
89 // Returns true if experimental features are enabled for IME input-views. | 99 // Returns true if experimental features are enabled for IME input-views. |
90 KEYBOARD_EXPORT bool IsExperimentalInputViewEnabled(); | 100 KEYBOARD_EXPORT bool IsExperimentalInputViewEnabled(); |
91 | 101 |
92 // Insert |text| into the active TextInputClient associated with |root_window|, | 102 // Insert |text| into the active TextInputClient associated with |root_window|, |
93 // if there is one. Returns true if |text| was successfully inserted. Note | 103 // if there is one. Returns true if |text| was successfully inserted. Note |
94 // that this may convert |text| into ui::KeyEvents for injection in some | 104 // that this may convert |text| into ui::KeyEvents for injection in some |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 145 |
136 // Gets the override content url. | 146 // Gets the override content url. |
137 KEYBOARD_EXPORT const GURL& GetOverrideContentUrl(); | 147 KEYBOARD_EXPORT const GURL& GetOverrideContentUrl(); |
138 | 148 |
139 // Logs the keyboard control event as a UMA stat. | 149 // Logs the keyboard control event as a UMA stat. |
140 void LogKeyboardControlEvent(KeyboardControlEvent event); | 150 void LogKeyboardControlEvent(KeyboardControlEvent event); |
141 | 151 |
142 } // namespace keyboard | 152 } // namespace keyboard |
143 | 153 |
144 #endif // UI_KEYBOARD_KEYBOARD_UTIL_H_ | 154 #endif // UI_KEYBOARD_KEYBOARD_UTIL_H_ |
OLD | NEW |