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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 TextInputClient* client = GetTextInputClient(); | 140 TextInputClient* client = GetTextInputClient(); |
141 return client ? | 141 return client ? |
142 client->GetAttachedWindow() : static_cast<gfx::NativeWindow>(NULL); | 142 client->GetAttachedWindow() : static_cast<gfx::NativeWindow>(NULL); |
143 } | 143 } |
144 | 144 |
145 ui::TextInputType InputMethodBridge::GetTextInputType() const { | 145 ui::TextInputType InputMethodBridge::GetTextInputType() const { |
146 TextInputClient* client = GetTextInputClient(); | 146 TextInputClient* client = GetTextInputClient(); |
147 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; | 147 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; |
148 } | 148 } |
149 | 149 |
| 150 ui::TextInputMode InputMethodBridge::GetTextInputMode() const { |
| 151 TextInputClient* client = GetTextInputClient(); |
| 152 return client ? client->GetTextInputMode() : ui::TEXT_INPUT_MODE_DEFAULT; |
| 153 } |
| 154 |
150 bool InputMethodBridge::CanComposeInline() const { | 155 bool InputMethodBridge::CanComposeInline() const { |
151 TextInputClient* client = GetTextInputClient(); | 156 TextInputClient* client = GetTextInputClient(); |
152 return client ? client->CanComposeInline() : true; | 157 return client ? client->CanComposeInline() : true; |
153 } | 158 } |
154 | 159 |
155 gfx::Rect InputMethodBridge::GetCaretBounds() { | 160 gfx::Rect InputMethodBridge::GetCaretBounds() { |
156 TextInputClient* client = GetTextInputClient(); | 161 TextInputClient* client = GetTextInputClient(); |
157 if (!client) | 162 if (!client) |
158 return gfx::Rect(); | 163 return gfx::Rect(); |
159 | 164 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 OnTextInputTypeChanged(focused); | 249 OnTextInputTypeChanged(focused); |
245 OnCaretBoundsChanged(focused); | 250 OnCaretBoundsChanged(focused); |
246 } | 251 } |
247 | 252 |
248 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { | 253 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { |
249 return host_; | 254 return host_; |
250 } | 255 } |
251 | 256 |
252 | 257 |
253 } // namespace views | 258 } // namespace views |
OLD | NEW |