| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (client) | 203 if (client) |
| 204 client->InsertText(text); | 204 client->InsertText(text); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void InputMethodBridge::InsertChar(base::char16 ch, int flags) { | 207 void InputMethodBridge::InsertChar(base::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 } |
| 212 | 212 |
| 213 gfx::NativeWindow InputMethodBridge::GetAttachedWindow() const { | |
| 214 TextInputClient* client = GetTextInputClient(); | |
| 215 return client ? | |
| 216 client->GetAttachedWindow() : static_cast<gfx::NativeWindow>(NULL); | |
| 217 } | |
| 218 | |
| 219 ui::TextInputType InputMethodBridge::GetTextInputType() const { | 213 ui::TextInputType InputMethodBridge::GetTextInputType() const { |
| 220 TextInputClient* client = GetTextInputClient(); | 214 TextInputClient* client = GetTextInputClient(); |
| 221 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; | 215 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; |
| 222 } | 216 } |
| 223 | 217 |
| 224 ui::TextInputMode InputMethodBridge::GetTextInputMode() const { | 218 ui::TextInputMode InputMethodBridge::GetTextInputMode() const { |
| 225 TextInputClient* client = GetTextInputClient(); | 219 TextInputClient* client = GetTextInputClient(); |
| 226 return client ? client->GetTextInputMode() : ui::TEXT_INPUT_MODE_DEFAULT; | 220 return client ? client->GetTextInputMode() : ui::TEXT_INPUT_MODE_DEFAULT; |
| 227 } | 221 } |
| 228 | 222 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 OnTextInputTypeChanged(focused); | 326 OnTextInputTypeChanged(focused); |
| 333 OnCaretBoundsChanged(focused); | 327 OnCaretBoundsChanged(focused); |
| 334 } | 328 } |
| 335 | 329 |
| 336 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { | 330 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { |
| 337 return host_; | 331 return host_; |
| 338 } | 332 } |
| 339 | 333 |
| 340 | 334 |
| 341 } // namespace views | 335 } // namespace views |
| OLD | NEW |