| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "ui/base/ime/input_method_delegate.h" | 10 #include "ui/base/ime/input_method_delegate.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 TextInputClient* old = text_input_client_; | 138 TextInputClient* old = text_input_client_; |
| 139 if (old == client) | 139 if (old == client) |
| 140 return; | 140 return; |
| 141 OnWillChangeFocusedClient(old, client); | 141 OnWillChangeFocusedClient(old, client); |
| 142 text_input_client_ = client; // NULL allowed. | 142 text_input_client_ = client; // NULL allowed. |
| 143 OnDidChangeFocusedClient(old, client); | 143 OnDidChangeFocusedClient(old, client); |
| 144 NotifyTextInputStateChanged(text_input_client_); | 144 NotifyTextInputStateChanged(text_input_client_); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void InputMethodBase::OnCandidateWindowShown() { | |
| 148 base::MessageLoop::current()->PostTask( | |
| 149 FROM_HERE, | |
| 150 base::Bind(&InputMethodBase::CandidateWindowShownCallback, AsWeakPtr())); | |
| 151 } | |
| 152 | |
| 153 void InputMethodBase::OnCandidateWindowUpdated() { | |
| 154 base::MessageLoop::current()->PostTask( | |
| 155 FROM_HERE, | |
| 156 base::Bind(&InputMethodBase::CandidateWindowUpdatedCallback, | |
| 157 AsWeakPtr())); | |
| 158 } | |
| 159 | |
| 160 void InputMethodBase::OnCandidateWindowHidden() { | |
| 161 base::MessageLoop::current()->PostTask( | |
| 162 FROM_HERE, | |
| 163 base::Bind(&InputMethodBase::CandidateWindowHiddenCallback, AsWeakPtr())); | |
| 164 } | |
| 165 | |
| 166 void InputMethodBase::CandidateWindowShownCallback() { | |
| 167 if (TextInputClient* text_input_client = GetTextInputClient()) | |
| 168 text_input_client->OnCandidateWindowShown(); | |
| 169 } | |
| 170 | |
| 171 void InputMethodBase::CandidateWindowUpdatedCallback() { | |
| 172 if (TextInputClient* text_input_client = GetTextInputClient()) | |
| 173 text_input_client->OnCandidateWindowUpdated(); | |
| 174 } | |
| 175 | |
| 176 void InputMethodBase::CandidateWindowHiddenCallback() { | |
| 177 if (TextInputClient* text_input_client = GetTextInputClient()) | |
| 178 text_input_client->OnCandidateWindowHidden(); | |
| 179 } | |
| 180 | |
| 181 } // namespace ui | 147 } // namespace ui |
| OLD | NEW |