summaryrefslogtreecommitdiffstats
path: root/chromium/ui/keyboard/keyboard_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/keyboard/keyboard_util.h')
-rw-r--r--chromium/ui/keyboard/keyboard_util.h72
1 files changed, 70 insertions, 2 deletions
diff --git a/chromium/ui/keyboard/keyboard_util.h b/chromium/ui/keyboard/keyboard_util.h
index 232127320b0..c2b31b8819d 100644
--- a/chromium/ui/keyboard/keyboard_util.h
+++ b/chromium/ui/keyboard/keyboard_util.h
@@ -14,6 +14,12 @@
struct GritResourceMap;
+namespace aura {
+class WindowTreeHost;
+}
+
+class GURL;
+
namespace keyboard {
// Enumeration of swipe directions.
@@ -32,12 +38,67 @@ enum KeyboardControlEvent {
KEYBOARD_CONTROL_MAX,
};
+// An enumeration of keyboard overscroll override value.
+enum KeyboardOverscrolOverride {
+ KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED = 0,
+ KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED,
+ KEYBOARD_OVERSCROLL_OVERRIDE_NONE,
+};
+
+// An enumeration of keyboard policy settings.
+enum KeyboardShowOverride {
+ KEYBOARD_SHOW_OVERRIDE_DISABLED = 0,
+ KEYBOARD_SHOW_OVERRIDE_ENABLED,
+ KEYBOARD_SHOW_OVERRIDE_NONE,
+};
+
+// Gets the default keyboard bounds from |window_bounds|.
+KEYBOARD_EXPORT gfx::Rect DefaultKeyboardBoundsFromWindowBounds(
+ const gfx::Rect& window_bounds);
+
+// Gets the caculated keyboard bounds from |window_bounds|. The keyboard height
+// is specified by |keyboard_height|.
+KEYBOARD_EXPORT gfx::Rect KeyboardBoundsFromWindowBounds(
+ const gfx::Rect& window_bounds, int keyboard_height);
+
+// Sets the state of the a11y onscreen keyboard.
+KEYBOARD_EXPORT void SetAccessibilityKeyboardEnabled(bool enabled);
+
+// Gets the state of the a11y onscreen keyboard.
+KEYBOARD_EXPORT bool GetAccessibilityKeyboardEnabled();
+
+// Sets the state of the touch onscreen keyboard.
+KEYBOARD_EXPORT void SetTouchKeyboardEnabled(bool enabled);
+
+// Gets the state of the touch onscreen keyboard.
+KEYBOARD_EXPORT bool GetTouchKeyboardEnabled();
+
+// Gets the default keyboard layout.
+KEYBOARD_EXPORT std::string GetKeyboardLayout();
+
// Returns true if the virtual keyboard is enabled.
KEYBOARD_EXPORT bool IsKeyboardEnabled();
// Returns true if the keyboard usability test is enabled.
KEYBOARD_EXPORT bool IsKeyboardUsabilityExperimentEnabled();
+// Returns true if keyboard overscroll mode is enabled.
+KEYBOARD_EXPORT bool IsKeyboardOverscrollEnabled();
+
+// Sets temporary keyboard overscroll override.
+KEYBOARD_EXPORT void SetKeyboardOverscrollOverride(
+ KeyboardOverscrolOverride override);
+
+// Sets policy override on whether to show the keyboard.
+KEYBOARD_EXPORT void SetKeyboardShowOverride(KeyboardShowOverride override);
+
+// Returns true if an IME extension can specify a custom input view for the
+// virtual keyboard window.
+KEYBOARD_EXPORT bool IsInputViewEnabled();
+
+// Returns true if experimental features are enabled for IME input-views.
+KEYBOARD_EXPORT bool IsExperimentalInputViewEnabled();
+
// Insert |text| into the active TextInputClient associated with |root_window|,
// if there is one. Returns true if |text| was successfully inserted. Note
// that this may convert |text| into ui::KeyEvents for injection in some
@@ -49,7 +110,7 @@ KEYBOARD_EXPORT bool InsertText(const base::string16& text,
// successfully moved according to |swipe_direction|.
KEYBOARD_EXPORT bool MoveCursor(int swipe_direction,
int modifier_flags,
- aura::WindowEventDispatcher* dispatcher);
+ aura::WindowTreeHost* host);
// Sends a fabricated key event, where |type| is the event type, |key_value|
// is the unicode value of the character, |key_code| is the legacy key code
@@ -62,7 +123,7 @@ KEYBOARD_EXPORT bool SendKeyEvent(std::string type,
int key_code,
std::string key_name,
int modifiers,
- aura::WindowEventDispatcher* dispatcher);
+ aura::WindowTreeHost* host);
// Marks that the keyboard load has started. This is used to measure the time it
// takes to fully load the keyboard. This should be called before
@@ -78,6 +139,13 @@ KEYBOARD_EXPORT const void MarkKeyboardLoadFinished();
KEYBOARD_EXPORT const GritResourceMap* GetKeyboardExtensionResources(
size_t* size);
+// Sets the override content url.
+// This is used by for input view for extension IMEs.
+KEYBOARD_EXPORT void SetOverrideContentUrl(const GURL& url);
+
+// Gets the override content url.
+KEYBOARD_EXPORT const GURL& GetOverrideContentUrl();
+
// Logs the keyboard control event as a UMA stat.
void LogKeyboardControlEvent(KeyboardControlEvent event);