| 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 #include "base/logging.h" | 7 #include "base/logging.h" |
| 7 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 11 #include "base/threading/thread_local_storage.h" | 12 #include "base/threading/thread_local_storage.h" |
| 12 #include "base/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
| 13 #include "base/win/scoped_variant.h" | 14 #include "base/win/scoped_variant.h" |
| 14 #include "ui/base/ime/text_input_client.h" | 15 #include "ui/base/ime/text_input_client.h" |
| 15 #include "ui/base/win/tsf_bridge.h" | 16 #include "ui/base/win/tsf_bridge.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE { | 177 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE { |
| 177 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 178 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 178 DCHECK(IsInitialized()); | 179 DCHECK(IsInitialized()); |
| 179 if (client_ == client) { | 180 if (client_ == client) { |
| 180 client_ = NULL; | 181 client_ = NULL; |
| 181 text_store_->get()->SetFocusedTextInputClient(NULL, NULL); | 182 text_store_->get()->SetFocusedTextInputClient(NULL, NULL); |
| 182 password_text_store_->get()->SetFocusedTextInputClient(NULL, NULL); | 183 password_text_store_->get()->SetFocusedTextInputClient(NULL, NULL); |
| 183 } | 184 } |
| 184 } | 185 } |
| 185 | 186 |
| 187 virtual base::win::ScopedComPtr<ITfThreadMgr> GetThreadManager() OVERRIDE { |
| 188 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 189 DCHECK(IsInitialized()); |
| 190 return thread_manager_; |
| 191 } |
| 192 |
| 186 private: | 193 private: |
| 187 friend struct DefaultSingletonTraits<TsfBridgeDelegate>; | 194 friend struct DefaultSingletonTraits<TsfBridgeDelegate>; |
| 188 | 195 |
| 189 // Initializes |document_manager_for_editable_|. | 196 // Initializes |document_manager_for_editable_|. |
| 190 bool InitializeForEnabledDocumentManager() { | 197 bool InitializeForEnabledDocumentManager() { |
| 191 if (FAILED(thread_manager_->CreateDocumentMgr( | 198 if (FAILED(thread_manager_->CreateDocumentMgr( |
| 192 document_manager_for_editable_.Receive()))) { | 199 document_manager_for_editable_.Receive()))) { |
| 193 VLOG(1) << "Failed to create Document Manager."; | 200 VLOG(1) << "Failed to create Document Manager."; |
| 194 return false; | 201 return false; |
| 195 } | 202 } |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 VLOG(1) << "Do not use TsfBridge without UI thread."; | 486 VLOG(1) << "Do not use TsfBridge without UI thread."; |
| 480 return NULL; | 487 return NULL; |
| 481 } | 488 } |
| 482 TsfBridgeDelegate* delegate = | 489 TsfBridgeDelegate* delegate = |
| 483 static_cast<TsfBridgeDelegate*>(tls_tsf_bridge.Get()); | 490 static_cast<TsfBridgeDelegate*>(tls_tsf_bridge.Get()); |
| 484 DCHECK(delegate) << "Do no call GetInstance before TsfBridge::Initialize."; | 491 DCHECK(delegate) << "Do no call GetInstance before TsfBridge::Initialize."; |
| 485 return delegate; | 492 return delegate; |
| 486 } | 493 } |
| 487 | 494 |
| 488 } // namespace ui | 495 } // namespace ui |
| OLD | NEW |