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 "components/arc/ime/arc_ime_service.h" | 5 #include "components/arc/ime/arc_ime_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 //////////////////////////////////////////////////////////////////////////////// | 134 //////////////////////////////////////////////////////////////////////////////// |
135 // Overridden from arc::ArcImeBridge::Delegate | 135 // Overridden from arc::ArcImeBridge::Delegate |
136 | 136 |
137 void ArcImeService::OnTextInputTypeChanged(ui::TextInputType type) { | 137 void ArcImeService::OnTextInputTypeChanged(ui::TextInputType type) { |
138 if (ime_type_ == type) | 138 if (ime_type_ == type) |
139 return; | 139 return; |
140 ime_type_ = type; | 140 ime_type_ = type; |
141 | 141 |
142 ui::InputMethod* const input_method = GetInputMethod(); | 142 ui::InputMethod* const input_method = GetInputMethod(); |
143 if (input_method) { | 143 if (input_method) |
144 input_method->OnTextInputTypeChanged(this); | 144 input_method->OnTextInputTypeChanged(this); |
145 // TODO(crbug.com/581282): Remove this piggyback call when | |
146 // ImeInstance::ShowImeIfNeeded is wired to ARC. | |
147 if (input_method->GetTextInputClient() == this && | |
148 ime_type_ != ui::TEXT_INPUT_TYPE_NONE) { | |
149 input_method->ShowImeIfNeeded(); | |
150 } | |
151 } | |
152 } | 145 } |
153 | 146 |
154 void ArcImeService::OnCursorRectChanged(const gfx::Rect& rect) { | 147 void ArcImeService::OnCursorRectChanged(const gfx::Rect& rect) { |
155 if (cursor_rect_ == rect) | 148 if (cursor_rect_ == rect) |
156 return; | 149 return; |
157 cursor_rect_ = rect; | 150 cursor_rect_ = rect; |
158 | 151 |
159 ui::InputMethod* const input_method = GetInputMethod(); | 152 ui::InputMethod* const input_method = GetInputMethod(); |
160 if (input_method) | 153 if (input_method) |
161 input_method->OnCaretBoundsChanged(this); | 154 input_method->OnCaretBoundsChanged(this); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 base::i18n::TextDirection direction) { | 325 base::i18n::TextDirection direction) { |
333 return false; | 326 return false; |
334 } | 327 } |
335 | 328 |
336 bool ArcImeService::IsTextEditCommandEnabled( | 329 bool ArcImeService::IsTextEditCommandEnabled( |
337 ui::TextEditCommand command) const { | 330 ui::TextEditCommand command) const { |
338 return false; | 331 return false; |
339 } | 332 } |
340 | 333 |
341 } // namespace arc | 334 } // namespace arc |
OLD | NEW |