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/base/ime/input_method_base.h" | 5 #include "ui/base/ime/input_method_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/ime/input_method_delegate.h" | 8 #include "ui/base/ime/input_method_delegate.h" |
9 #include "ui/base/ime/input_method_observer.h" | 9 #include "ui/base/ime/input_method_observer.h" |
10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (!IsTextInputClientFocused(client)) | 60 if (!IsTextInputClientFocused(client)) |
61 return; | 61 return; |
62 NotifyTextInputStateChanged(client); | 62 NotifyTextInputStateChanged(client); |
63 } | 63 } |
64 | 64 |
65 TextInputType InputMethodBase::GetTextInputType() const { | 65 TextInputType InputMethodBase::GetTextInputType() const { |
66 TextInputClient* client = GetTextInputClient(); | 66 TextInputClient* client = GetTextInputClient(); |
67 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE; | 67 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE; |
68 } | 68 } |
69 | 69 |
| 70 TextInputMode InputMethodBase::GetTextInputMode() const { |
| 71 TextInputClient* client = GetTextInputClient(); |
| 72 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; |
| 73 } |
| 74 |
70 bool InputMethodBase::CanComposeInline() const { | 75 bool InputMethodBase::CanComposeInline() const { |
71 TextInputClient* client = GetTextInputClient(); | 76 TextInputClient* client = GetTextInputClient(); |
72 return client ? client->CanComposeInline() : true; | 77 return client ? client->CanComposeInline() : true; |
73 } | 78 } |
74 | 79 |
75 void InputMethodBase::AddObserver(InputMethodObserver* observer) { | 80 void InputMethodBase::AddObserver(InputMethodObserver* observer) { |
76 observer_list_.AddObserver(observer); | 81 observer_list_.AddObserver(observer); |
77 } | 82 } |
78 | 83 |
79 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { | 84 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { |
(...skipping 27 matching lines...) Expand all Loading... |
107 } | 112 } |
108 | 113 |
109 void InputMethodBase::NotifyTextInputStateChanged( | 114 void InputMethodBase::NotifyTextInputStateChanged( |
110 const TextInputClient* client) { | 115 const TextInputClient* client) { |
111 FOR_EACH_OBSERVER(InputMethodObserver, | 116 FOR_EACH_OBSERVER(InputMethodObserver, |
112 observer_list_, | 117 observer_list_, |
113 OnTextInputStateChanged(client)); | 118 OnTextInputStateChanged(client)); |
114 } | 119 } |
115 | 120 |
116 } // namespace ui | 121 } // namespace ui |
OLD | NEW |