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/ime/input_method.h" | 7 #include "ui/base/ime/input_method.h" |
8 #include "ui/base/ime/input_method_observer.h" | 8 #include "ui/base/ime/input_method_observer.h" |
9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (client) | 191 if (client) |
192 client->ConfirmCompositionText(); | 192 client->ConfirmCompositionText(); |
193 } | 193 } |
194 | 194 |
195 void InputMethodBridge::ClearCompositionText() { | 195 void InputMethodBridge::ClearCompositionText() { |
196 TextInputClient* client = GetTextInputClient(); | 196 TextInputClient* client = GetTextInputClient(); |
197 if (client) | 197 if (client) |
198 client->ClearCompositionText(); | 198 client->ClearCompositionText(); |
199 } | 199 } |
200 | 200 |
201 void InputMethodBridge::InsertText(const string16& text) { | 201 void InputMethodBridge::InsertText(const base::string16& text) { |
202 TextInputClient* client = GetTextInputClient(); | 202 TextInputClient* client = GetTextInputClient(); |
203 if (client) | 203 if (client) |
204 client->InsertText(text); | 204 client->InsertText(text); |
205 } | 205 } |
206 | 206 |
207 void InputMethodBridge::InsertChar(char16 ch, int flags) { | 207 void InputMethodBridge::InsertChar(char16 ch, int flags) { |
208 TextInputClient* client = GetTextInputClient(); | 208 TextInputClient* client = GetTextInputClient(); |
209 if (client) | 209 if (client) |
210 client->InsertChar(ch, flags); | 210 client->InsertChar(ch, flags); |
211 } | 211 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 TextInputClient* client = GetTextInputClient(); | 273 TextInputClient* client = GetTextInputClient(); |
274 return client ? client->SetSelectionRange(range) : false; | 274 return client ? client->SetSelectionRange(range) : false; |
275 } | 275 } |
276 | 276 |
277 bool InputMethodBridge::DeleteRange(const gfx::Range& range) { | 277 bool InputMethodBridge::DeleteRange(const gfx::Range& range) { |
278 TextInputClient* client = GetTextInputClient(); | 278 TextInputClient* client = GetTextInputClient(); |
279 return client ? client->DeleteRange(range) : false; | 279 return client ? client->DeleteRange(range) : false; |
280 } | 280 } |
281 | 281 |
282 bool InputMethodBridge::GetTextFromRange(const gfx::Range& range, | 282 bool InputMethodBridge::GetTextFromRange(const gfx::Range& range, |
283 string16* text) const { | 283 base::string16* text) const { |
284 TextInputClient* client = GetTextInputClient(); | 284 TextInputClient* client = GetTextInputClient(); |
285 return client ? client->GetTextFromRange(range, text) : false; | 285 return client ? client->GetTextFromRange(range, text) : false; |
286 } | 286 } |
287 | 287 |
288 void InputMethodBridge::OnInputMethodChanged() { | 288 void InputMethodBridge::OnInputMethodChanged() { |
289 TextInputClient* client = GetTextInputClient(); | 289 TextInputClient* client = GetTextInputClient(); |
290 if (client) | 290 if (client) |
291 client->OnInputMethodChanged(); | 291 client->OnInputMethodChanged(); |
292 } | 292 } |
293 | 293 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 OnTextInputTypeChanged(focused); | 332 OnTextInputTypeChanged(focused); |
333 OnCaretBoundsChanged(focused); | 333 OnCaretBoundsChanged(focused); |
334 } | 334 } |
335 | 335 |
336 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { | 336 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { |
337 return host_; | 337 return host_; |
338 } | 338 } |
339 | 339 |
340 | 340 |
341 } // namespace views | 341 } // namespace views |
OLD | NEW |