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 <msctf.h> | 5 #include <msctf.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 bool TSFBridgeDelegate::CreateDocumentManager(TSFTextStore* text_store, | 276 bool TSFBridgeDelegate::CreateDocumentManager(TSFTextStore* text_store, |
277 ITfDocumentMgr** document_manager, | 277 ITfDocumentMgr** document_manager, |
278 ITfContext** context, | 278 ITfContext** context, |
279 DWORD* source_cookie) { | 279 DWORD* source_cookie) { |
280 if (FAILED(thread_manager_->CreateDocumentMgr(document_manager))) { | 280 if (FAILED(thread_manager_->CreateDocumentMgr(document_manager))) { |
281 DVLOG(1) << "Failed to create Document Manager."; | 281 DVLOG(1) << "Failed to create Document Manager."; |
282 return false; | 282 return false; |
283 } | 283 } |
284 | 284 |
285 DWORD edit_cookie = TF_INVALID_EDIT_COOKIE; | 285 DWORD edit_cookie = TF_INVALID_EDIT_COOKIE; |
286 if (FAILED(document_manager_for_editable_->CreateContext( | 286 if (FAILED((*document_manager)->CreateContext( |
287 client_id_, | 287 client_id_, |
288 0, | 288 0, |
289 static_cast<ITextStoreACP*>(text_store), | 289 static_cast<ITextStoreACP*>(text_store), |
290 context, | 290 context, |
291 &edit_cookie))) { | 291 &edit_cookie))) { |
292 DVLOG(1) << "Failed to create Context."; | 292 DVLOG(1) << "Failed to create Context."; |
293 return false; | 293 return false; |
294 } | 294 } |
295 | 295 |
296 if (FAILED((*document_manager)->Push(*context))) { | 296 if (FAILED((*document_manager)->Push(*context))) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 return delegate; | 482 return delegate; |
483 } | 483 } |
484 | 484 |
485 // static | 485 // static |
486 void TSFBridge::Finalize(void* data) { | 486 void TSFBridge::Finalize(void* data) { |
487 TSFBridgeDelegate* delegate = static_cast<TSFBridgeDelegate*>(data); | 487 TSFBridgeDelegate* delegate = static_cast<TSFBridgeDelegate*>(data); |
488 delete delegate; | 488 delete delegate; |
489 } | 489 } |
490 | 490 |
491 } // namespace ui | 491 } // namespace ui |
OLD | NEW |