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

Side by Side Diff: ui/keyboard/keyboard_ui.cc

Issue 2554513002: Change |EnsureCaretInRect| to |EnsureCaretNotInRect|. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ui/base/ime/text_input_client.h ('k') | ui/views/controls/prefix_selector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "ui/keyboard/keyboard_ui.h" 5 #include "ui/keyboard/keyboard_ui.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/base/ime/input_method.h" 8 #include "ui/base/ime/input_method.h"
9 #include "ui/base/ime/text_input_client.h" 9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/keyboard/keyboard_controller.h" 10 #include "ui/keyboard/keyboard_controller.h"
(...skipping 13 matching lines...) Expand all
24 void KeyboardUI::HideKeyboardContainer(aura::Window* container) { 24 void KeyboardUI::HideKeyboardContainer(aura::Window* container) {
25 if (HasKeyboardWindow()) { 25 if (HasKeyboardWindow()) {
26 container->Hide(); 26 container->Hide();
27 GetKeyboardWindow()->Hide(); 27 GetKeyboardWindow()->Hide();
28 } 28 }
29 } 29 }
30 30
31 void KeyboardUI::EnsureCaretInWorkArea() { 31 void KeyboardUI::EnsureCaretInWorkArea() {
32 if (GetInputMethod()->GetTextInputClient()) { 32 if (GetInputMethod()->GetTextInputClient()) {
33 aura::Window* keyboard_window = GetKeyboardWindow(); 33 aura::Window* keyboard_window = GetKeyboardWindow();
34 aura::Window* root_window = keyboard_window->GetRootWindow(); 34 GetInputMethod()->GetTextInputClient()->EnsureCaretNotInRect(
35 gfx::Rect available_bounds = root_window->bounds(); 35 keyboard_window->GetBoundsInScreen());
36 gfx::Rect keyboard_bounds = keyboard_window->bounds();
37 available_bounds.set_height(available_bounds.height() -
38 keyboard_bounds.height());
39 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(available_bounds);
40 } 36 }
41 } 37 }
42 38
43 void KeyboardUI::SetController(KeyboardController* controller) { 39 void KeyboardUI::SetController(KeyboardController* controller) {
44 keyboard_controller_ = controller; 40 keyboard_controller_ = controller;
45 } 41 }
46 42
47 } // namespace keyboard 43 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/base/ime/text_input_client.h ('k') | ui/views/controls/prefix_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698