Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: ui/base/win/tsf_bridge.cc

Issue 11148012: Introduce TsfEventRouter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE { 176 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE {
177 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 177 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
178 DCHECK(IsInitialized()); 178 DCHECK(IsInitialized());
179 if (client_ == client) { 179 if (client_ == client) {
180 client_ = NULL; 180 client_ = NULL;
181 text_store_->get()->SetFocusedTextInputClient(NULL, NULL); 181 text_store_->get()->SetFocusedTextInputClient(NULL, NULL);
182 password_text_store_->get()->SetFocusedTextInputClient(NULL, NULL); 182 password_text_store_->get()->SetFocusedTextInputClient(NULL, NULL);
183 } 183 }
184 } 184 }
185 185
186 virtual base::win::ScopedComPtr<ITfThreadMgr> GetThreadManager() OVERRIDE {
187 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
188 DCHECK(IsInitialized());
189 return thread_manager_;
190 }
191
186 private: 192 private:
187 friend struct DefaultSingletonTraits<TsfBridgeDelegate>; 193 friend struct DefaultSingletonTraits<TsfBridgeDelegate>;
188 194
189 // Initializes |document_manager_for_editable_|. 195 // Initializes |document_manager_for_editable_|.
190 bool InitializeForEnabledDocumentManager() { 196 bool InitializeForEnabledDocumentManager() {
191 if (FAILED(thread_manager_->CreateDocumentMgr( 197 if (FAILED(thread_manager_->CreateDocumentMgr(
192 document_manager_for_editable_.Receive()))) { 198 document_manager_for_editable_.Receive()))) {
193 VLOG(1) << "Failed to create Document Manager."; 199 VLOG(1) << "Failed to create Document Manager.";
194 return false; 200 return false;
195 } 201 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 VLOG(1) << "Do not use TsfBridge without UI thread."; 485 VLOG(1) << "Do not use TsfBridge without UI thread.";
480 return NULL; 486 return NULL;
481 } 487 }
482 TsfBridgeDelegate* delegate = 488 TsfBridgeDelegate* delegate =
483 static_cast<TsfBridgeDelegate*>(tls_tsf_bridge.Get()); 489 static_cast<TsfBridgeDelegate*>(tls_tsf_bridge.Get());
484 DCHECK(delegate) << "Do no call GetInstance before TsfBridge::Initialize."; 490 DCHECK(delegate) << "Do no call GetInstance before TsfBridge::Initialize.";
485 return delegate; 491 return delegate;
486 } 492 }
487 493
488 } // namespace ui 494 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698