Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: ui/keyboard/keyboard_ui.cc

Issue 1392713002: Extract content dependency from keyboard code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/keyboard/keyboard_ui.cc
diff --git a/ui/keyboard/keyboard_ui.cc b/ui/keyboard/keyboard_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0c5d98aed2933442b04bb7b034153c069751f04e
--- /dev/null
+++ b/ui/keyboard/keyboard_ui.cc
@@ -0,0 +1,67 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/keyboard/keyboard_ui.h"
+
+#include "ui/aura/window.h"
+#include "ui/base/ime/input_method.h"
+#include "ui/base/ime/text_input_client.h"
+#include "ui/keyboard/keyboard_controller.h"
+
+namespace keyboard {
+
+KeyboardUI::KeyboardUI()
+ : keyboard_controller_(nullptr) {
+}
+
+KeyboardUI::~KeyboardUI() {
+}
+
+aura::Window* KeyboardUI::GetKeyboardWindow() {
+ return nullptr;
+}
+
+bool KeyboardUI::HasKeyboardWindow() const {
+ return false;
+}
+
+void KeyboardUI::ShowKeyboardContainer(aura::Window* container) {
+ GetKeyboardWindow()->Show();
sky 2015/10/09 18:23:29 Is it assumed that GetKeyboardWindow() always crea
+ container->Show();
+}
+
+void KeyboardUI::HideKeyboardContainer(aura::Window* container) {
+ container->Hide();
+ GetKeyboardWindow()->Hide();
+}
+
+void KeyboardUI::SetUpdateInputType(ui::TextInputType type) {
+}
+
+void KeyboardUI::EnsureCaretInWorkArea() {
+ if (GetInputMethod()->GetTextInputClient()) {
+ aura::Window* keyboard_window = GetKeyboardWindow();
+ aura::Window* root_window = keyboard_window->GetRootWindow();
+ gfx::Rect available_bounds = root_window->bounds();
+ gfx::Rect keyboard_bounds = keyboard_window->bounds();
+ available_bounds.set_height(available_bounds.height() -
+ keyboard_bounds.height());
+ GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(available_bounds);
+ }
+}
+
+void KeyboardUI::SetController(KeyboardController* controller) {
+ keyboard_controller_ = controller;
+}
+
+void KeyboardUI::ReloadKeyboardIfNeeded() {
+}
+
+void KeyboardUI::InitInsets(const gfx::Rect& new_bounds) {
+}
+
+void KeyboardUI::ResetInsets() {
+}
+
+} // namespace keyboard

Powered by Google App Engine
This is Rietveld 408576698