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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 TextInputMode InputMethodBase::GetTextInputMode() const { | 82 TextInputMode InputMethodBase::GetTextInputMode() const { |
83 TextInputClient* client = GetTextInputClient(); | 83 TextInputClient* client = GetTextInputClient(); |
84 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; | 84 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; |
85 } | 85 } |
86 | 86 |
87 bool InputMethodBase::CanComposeInline() const { | 87 bool InputMethodBase::CanComposeInline() const { |
88 TextInputClient* client = GetTextInputClient(); | 88 TextInputClient* client = GetTextInputClient(); |
89 return client ? client->CanComposeInline() : true; | 89 return client ? client->CanComposeInline() : true; |
90 } | 90 } |
91 | 91 |
| 92 void InputMethodBase::ShowVirtualKeyboard() { |
| 93 FOR_EACH_OBSERVER(InputMethodObserver, |
| 94 observer_list_, |
| 95 OnShowVirtualKeyboard()); |
| 96 } |
| 97 |
92 void InputMethodBase::AddObserver(InputMethodObserver* observer) { | 98 void InputMethodBase::AddObserver(InputMethodObserver* observer) { |
93 observer_list_.AddObserver(observer); | 99 observer_list_.AddObserver(observer); |
94 } | 100 } |
95 | 101 |
96 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { | 102 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { |
97 observer_list_.RemoveObserver(observer); | 103 observer_list_.RemoveObserver(observer); |
98 } | 104 } |
99 | 105 |
100 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { | 106 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { |
101 return client && (client == GetTextInputClient()); | 107 return client && (client == GetTextInputClient()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 TextInputClient* old = text_input_client_; | 141 TextInputClient* old = text_input_client_; |
136 if (old == client) | 142 if (old == client) |
137 return; | 143 return; |
138 OnWillChangeFocusedClient(old, client); | 144 OnWillChangeFocusedClient(old, client); |
139 text_input_client_ = client; // NULL allowed. | 145 text_input_client_ = client; // NULL allowed. |
140 OnDidChangeFocusedClient(old, client); | 146 OnDidChangeFocusedClient(old, client); |
141 NotifyTextInputStateChanged(text_input_client_); | 147 NotifyTextInputStateChanged(text_input_client_); |
142 } | 148 } |
143 | 149 |
144 } // namespace ui | 150 } // namespace ui |
OLD | NEW |