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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 OnTextInputTypeChanged(client); | 255 OnTextInputTypeChanged(client); |
256 } | 256 } |
257 | 257 |
258 void TSFBridgeDelegate::RemoveFocusedClient(TextInputClient* client) { | 258 void TSFBridgeDelegate::RemoveFocusedClient(TextInputClient* client) { |
259 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); | 259 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); |
260 DCHECK(IsInitialized()); | 260 DCHECK(IsInitialized()); |
261 if (client_ != client) | 261 if (client_ != client) |
262 return; | 262 return; |
263 client_ = NULL; | 263 client_ = NULL; |
264 for (TSFDocumentMap::iterator it = tsf_document_map_.begin(); | 264 for (TSFDocumentMap::iterator it = tsf_document_map_.begin(); |
265 it != tsf_document_map_.end(); ++it) { | 265 it != tsf_document_map_.end(); ++it) { |
266 if (it->second.text_store.get() == NULL) | 266 if (it->second.text_store.get() == NULL) |
267 continue; | 267 continue; |
268 it->second.text_store->SetFocusedTextInputClient(NULL, NULL); | 268 it->second.text_store->SetFocusedTextInputClient(NULL, NULL); |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 TextInputClient* TSFBridgeDelegate::GetFocusedTextInputClient() const { | 272 TextInputClient* TSFBridgeDelegate::GetFocusedTextInputClient() const { |
273 return client_; | 273 return client_; |
274 } | 274 } |
275 | 275 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 return delegate; | 488 return delegate; |
489 } | 489 } |
490 | 490 |
491 // static | 491 // static |
492 void TSFBridge::Finalize(void* data) { | 492 void TSFBridge::Finalize(void* data) { |
493 TSFBridgeDelegate* delegate = static_cast<TSFBridgeDelegate*>(data); | 493 TSFBridgeDelegate* delegate = static_cast<TSFBridgeDelegate*>(data); |
494 delete delegate; | 494 delete delegate; |
495 } | 495 } |
496 | 496 |
497 } // namespace ui | 497 } // namespace ui |
OLD | NEW |