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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/keyboard/keyboard_ui.h"
6
7 #include "ui/aura/window.h"
8 #include "ui/base/ime/input_method.h"
9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/keyboard/keyboard_controller.h"
11
12 namespace keyboard {
13
14 KeyboardUI::KeyboardUI()
15 : keyboard_controller_(nullptr) {
16 }
17
18 KeyboardUI::~KeyboardUI() {
19 }
20
21 aura::Window* KeyboardUI::GetKeyboardWindow() {
22 return nullptr;
23 }
24
25 bool KeyboardUI::HasKeyboardWindow() const {
26 return false;
27 }
28
29 void KeyboardUI::ShowKeyboardContainer(aura::Window* container) {
30 GetKeyboardWindow()->Show();
sky 2015/10/09 18:23:29 Is it assumed that GetKeyboardWindow() always crea
31 container->Show();
32 }
33
34 void KeyboardUI::HideKeyboardContainer(aura::Window* container) {
35 container->Hide();
36 GetKeyboardWindow()->Hide();
37 }
38
39 void KeyboardUI::SetUpdateInputType(ui::TextInputType type) {
40 }
41
42 void KeyboardUI::EnsureCaretInWorkArea() {
43 if (GetInputMethod()->GetTextInputClient()) {
44 aura::Window* keyboard_window = GetKeyboardWindow();
45 aura::Window* root_window = keyboard_window->GetRootWindow();
46 gfx::Rect available_bounds = root_window->bounds();
47 gfx::Rect keyboard_bounds = keyboard_window->bounds();
48 available_bounds.set_height(available_bounds.height() -
49 keyboard_bounds.height());
50 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(available_bounds);
51 }
52 }
53
54 void KeyboardUI::SetController(KeyboardController* controller) {
55 keyboard_controller_ = controller;
56 }
57
58 void KeyboardUI::ReloadKeyboardIfNeeded() {
59 }
60
61 void KeyboardUI::InitInsets(const gfx::Rect& new_bounds) {
62 }
63
64 void KeyboardUI::ResetInsets() {
65 }
66
67 } // namespace keyboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698