OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/ime/input_method_bridge.h" | 5 #include "ui/views/ime/input_method_bridge.h" |
6 | 6 |
7 #include "ui/base/events/event.h" | 7 #include "ui/base/events/event.h" |
8 #include "ui/base/ime/input_method.h" | 8 #include "ui/base/ime/input_method.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return false; | 172 return false; |
173 | 173 |
174 return client->GetCompositionCharacterBounds(index, rect); | 174 return client->GetCompositionCharacterBounds(index, rect); |
175 } | 175 } |
176 | 176 |
177 bool InputMethodBridge::HasCompositionText() { | 177 bool InputMethodBridge::HasCompositionText() { |
178 TextInputClient* client = GetTextInputClient(); | 178 TextInputClient* client = GetTextInputClient(); |
179 return client ? client->HasCompositionText() : false; | 179 return client ? client->HasCompositionText() : false; |
180 } | 180 } |
181 | 181 |
182 bool InputMethodBridge::GetTextRange(ui::Range* range) { | 182 bool InputMethodBridge::GetTextRange(gfx::Range* range) { |
183 TextInputClient* client = GetTextInputClient(); | 183 TextInputClient* client = GetTextInputClient(); |
184 return client ? client->GetTextRange(range) : false; | 184 return client ? client->GetTextRange(range) : false; |
185 } | 185 } |
186 | 186 |
187 bool InputMethodBridge::GetCompositionTextRange(ui::Range* range) { | 187 bool InputMethodBridge::GetCompositionTextRange(gfx::Range* range) { |
188 TextInputClient* client = GetTextInputClient(); | 188 TextInputClient* client = GetTextInputClient(); |
189 return client ? client->GetCompositionTextRange(range) : false; | 189 return client ? client->GetCompositionTextRange(range) : false; |
190 } | 190 } |
191 | 191 |
192 bool InputMethodBridge::GetSelectionRange(ui::Range* range) { | 192 bool InputMethodBridge::GetSelectionRange(gfx::Range* range) { |
193 TextInputClient* client = GetTextInputClient(); | 193 TextInputClient* client = GetTextInputClient(); |
194 return client ? client->GetSelectionRange(range) : false; | 194 return client ? client->GetSelectionRange(range) : false; |
195 } | 195 } |
196 | 196 |
197 bool InputMethodBridge::SetSelectionRange(const ui::Range& range) { | 197 bool InputMethodBridge::SetSelectionRange(const gfx::Range& range) { |
198 TextInputClient* client = GetTextInputClient(); | 198 TextInputClient* client = GetTextInputClient(); |
199 return client ? client->SetSelectionRange(range) : false; | 199 return client ? client->SetSelectionRange(range) : false; |
200 } | 200 } |
201 | 201 |
202 bool InputMethodBridge::DeleteRange(const ui::Range& range) { | 202 bool InputMethodBridge::DeleteRange(const gfx::Range& range) { |
203 TextInputClient* client = GetTextInputClient(); | 203 TextInputClient* client = GetTextInputClient(); |
204 return client ? client->DeleteRange(range) : false; | 204 return client ? client->DeleteRange(range) : false; |
205 } | 205 } |
206 | 206 |
207 bool InputMethodBridge::GetTextFromRange( | 207 bool InputMethodBridge::GetTextFromRange( |
208 const ui::Range& range, string16* text) { | 208 const gfx::Range& range, string16* text) { |
209 TextInputClient* client = GetTextInputClient(); | 209 TextInputClient* client = GetTextInputClient(); |
210 return client ? client->GetTextFromRange(range, text) : false; | 210 return client ? client->GetTextFromRange(range, text) : false; |
211 } | 211 } |
212 | 212 |
213 void InputMethodBridge::OnInputMethodChanged() { | 213 void InputMethodBridge::OnInputMethodChanged() { |
214 TextInputClient* client = GetTextInputClient(); | 214 TextInputClient* client = GetTextInputClient(); |
215 if (client) | 215 if (client) |
216 client->OnInputMethodChanged(); | 216 client->OnInputMethodChanged(); |
217 } | 217 } |
218 | 218 |
(...skipping 29 matching lines...) Expand all Loading... |
248 OnTextInputTypeChanged(focused); | 248 OnTextInputTypeChanged(focused); |
249 OnCaretBoundsChanged(focused); | 249 OnCaretBoundsChanged(focused); |
250 } | 250 } |
251 | 251 |
252 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { | 252 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { |
253 return host_; | 253 return host_; |
254 } | 254 } |
255 | 255 |
256 | 256 |
257 } // namespace views | 257 } // namespace views |
OLD | NEW |