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/win/tsf_event_router.h" | 5 #include "ui/base/ime/win/tsf_event_router.h" |
6 | 6 |
7 #include <msctf.h> | 7 #include <msctf.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 ui_source_->UnadviseSink(ui_source_cookie_); | 186 ui_source_->UnadviseSink(ui_source_cookie_); |
187 ui_source_.Release(); | 187 ui_source_.Release(); |
188 } | 188 } |
189 ui_source_cookie_ = TF_INVALID_COOKIE; | 189 ui_source_cookie_ = TF_INVALID_COOKIE; |
190 | 190 |
191 if (!thread_manager) | 191 if (!thread_manager) |
192 return; | 192 return; |
193 | 193 |
194 base::win::ScopedComPtr<ITfDocumentMgr> document_manager; | 194 base::win::ScopedComPtr<ITfDocumentMgr> document_manager; |
195 if (FAILED(thread_manager->GetFocus(document_manager.Receive())) || | 195 if (FAILED(thread_manager->GetFocus(document_manager.Receive())) || |
| 196 !document_manager.get() || |
196 FAILED(document_manager->GetBase(context_.Receive())) || | 197 FAILED(document_manager->GetBase(context_.Receive())) || |
197 FAILED(context_source_.QueryFrom(context_))) | 198 FAILED(context_source_.QueryFrom(context_))) |
198 return; | 199 return; |
199 context_source_->AdviseSink(IID_ITfTextEditSink, | 200 context_source_->AdviseSink(IID_ITfTextEditSink, |
200 static_cast<ITfTextEditSink*>(this), | 201 static_cast<ITfTextEditSink*>(this), |
201 &context_source_cookie_); | 202 &context_source_cookie_); |
202 | 203 |
203 if (FAILED(ui_element_manager_.QueryFrom(thread_manager)) || | 204 if (FAILED(ui_element_manager_.QueryFrom(thread_manager)) || |
204 FAILED(ui_source_.QueryFrom(ui_element_manager_))) | 205 FAILED(ui_source_.QueryFrom(ui_element_manager_))) |
205 return; | 206 return; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 298 |
298 void TSFEventRouter::OnTSFEndComposition() { | 299 void TSFEventRouter::OnTSFEndComposition() { |
299 observer_->OnTSFEndComposition(); | 300 observer_->OnTSFEndComposition(); |
300 } | 301 } |
301 | 302 |
302 void TSFEventRouter::SetManager(ITfThreadMgr* thread_manager) { | 303 void TSFEventRouter::SetManager(ITfThreadMgr* thread_manager) { |
303 delegate_->SetManager(thread_manager); | 304 delegate_->SetManager(thread_manager); |
304 } | 305 } |
305 | 306 |
306 } // namespace ui | 307 } // namespace ui |
OLD | NEW |