| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/input_method/input_method_engine.h" | 5 #include "chrome/browser/ui/input_method/input_method_engine.h" |
| 6 | 6 |
| 7 #include "content/public/browser/render_frame_host.h" | 7 #include "content/public/browser/render_frame_host.h" |
| 8 #include "ui/base/ime/composition_text.h" | 8 #include "ui/base/ime/composition_text.h" |
| 9 #include "ui/base/ime/ime_bridge.h" | 9 #include "ui/base/ime/ime_bridge.h" |
| 10 #include "ui/base/ime/ime_input_context_handler_interface.h" | 10 #include "ui/base/ime/ime_input_context_handler_interface.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void InputMethodEngine::CloseImeWindows() { | 93 void InputMethodEngine::CloseImeWindows() { |
| 94 if (follow_cursor_window_) | 94 if (follow_cursor_window_) |
| 95 follow_cursor_window_->Close(); | 95 follow_cursor_window_->Close(); |
| 96 for (auto window : normal_windows_) | 96 for (auto window : normal_windows_) |
| 97 window->Close(); | 97 window->Close(); |
| 98 normal_windows_.clear(); | 98 normal_windows_.clear(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void InputMethodEngine::FocusIn( | |
| 102 const ui::IMEEngineHandlerInterface::InputContext& input_context) { | |
| 103 InputMethodEngineBase::FocusIn(input_context); | |
| 104 if (follow_cursor_window_) | |
| 105 follow_cursor_window_->Show(); | |
| 106 } | |
| 107 | |
| 108 void InputMethodEngine::FocusOut() { | 101 void InputMethodEngine::FocusOut() { |
| 109 InputMethodEngineBase::FocusOut(); | 102 InputMethodEngineBase::FocusOut(); |
| 110 if (follow_cursor_window_) | 103 if (follow_cursor_window_) |
| 111 follow_cursor_window_->Hide(); | 104 follow_cursor_window_->Hide(); |
| 112 } | 105 } |
| 113 | 106 |
| 114 void InputMethodEngine::SetCompositionBounds( | 107 void InputMethodEngine::SetCompositionBounds( |
| 115 const std::vector<gfx::Rect>& bounds) { | 108 const std::vector<gfx::Rect>& bounds) { |
| 116 InputMethodEngineBase::SetCompositionBounds(bounds); | 109 InputMethodEngineBase::SetCompositionBounds(bounds); |
| 117 if (!bounds.empty()) { | 110 if (!bounds.empty()) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 ui::IMEInputContextHandlerInterface* input_context = | 185 ui::IMEInputContextHandlerInterface* input_context = |
| 193 ui::IMEBridge::Get()->GetInputContextHandler(); | 186 ui::IMEBridge::Get()->GetInputContextHandler(); |
| 194 if (!input_context) | 187 if (!input_context) |
| 195 return false; | 188 return false; |
| 196 input_context->SendKeyEvent(event); | 189 input_context->SendKeyEvent(event); |
| 197 | 190 |
| 198 return true; | 191 return true; |
| 199 } | 192 } |
| 200 | 193 |
| 201 } // namespace input_method | 194 } // namespace input_method |
| OLD | NEW |