OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "win8/metro_driver/ime/text_service.h" | 5 #include "win8/metro_driver/ime/text_service.h" |
6 | 6 |
7 #include <msctf.h> | 7 #include <msctf.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/win/scoped_variant.h" | 10 #include "base/win/scoped_variant.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // position synchronously. | 80 // position synchronously. |
81 // The most complicated part is the OnDocumentChanged handler. Since some IMEs | 81 // The most complicated part is the OnDocumentChanged handler. Since some IMEs |
82 // such as Japanese IMEs drastically change their behavior depending on | 82 // such as Japanese IMEs drastically change their behavior depending on |
83 // properties exposed from the virtual document, we need to set up a lot | 83 // properties exposed from the virtual document, we need to set up a lot |
84 // properties carefully and correctly. See DocumentBinding class in this file | 84 // properties carefully and correctly. See DocumentBinding class in this file |
85 // about what will be involved in this multi-phase construction. See also | 85 // about what will be involved in this multi-phase construction. See also |
86 // text_store.cc and input_scope.cc for more underlying details. | 86 // text_store.cc and input_scope.cc for more underlying details. |
87 | 87 |
88 namespace metro_driver { | 88 namespace metro_driver { |
89 namespace { | 89 namespace { |
90 typedef TSFTextStore TextStore; | |
91 | 90 |
92 // Japanese IME expects the default value of this compartment is | 91 // Japanese IME expects the default value of this compartment is |
93 // TF_SENTENCEMODE_PHRASEPREDICT to emulate IMM32 behavior. This value is | 92 // TF_SENTENCEMODE_PHRASEPREDICT to emulate IMM32 behavior. This value is |
94 // managed per thread, thus setting this value at once is sufficient. This | 93 // managed per thread, thus setting this value at once is sufficient. This |
95 // value never affects non-Japanese IMEs. | 94 // value never affects non-Japanese IMEs. |
96 bool InitializeSentenceMode(ITfThreadMgr2* thread_manager, | 95 bool InitializeSentenceMode(ITfThreadMgr2* thread_manager, |
97 TfClientId client_id) { | 96 TfClientId client_id) { |
98 base::win::ScopedComPtr<ITfCompartmentMgr> thread_compartment_manager; | 97 base::win::ScopedComPtr<ITfCompartmentMgr> thread_compartment_manager; |
99 HRESULT hr = thread_compartment_manager.QueryFrom(thread_manager); | 98 HRESULT hr = thread_compartment_manager.QueryFrom(thread_manager); |
100 if (FAILED(hr)) { | 99 if (FAILED(hr)) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 thread_manager->Deactivate(); | 484 thread_manager->Deactivate(); |
486 return scoped_ptr<TextService>(); | 485 return scoped_ptr<TextService>(); |
487 } | 486 } |
488 return scoped_ptr<TextService>(new TextServiceImpl(thread_manager, | 487 return scoped_ptr<TextService>(new TextServiceImpl(thread_manager, |
489 client_id, | 488 client_id, |
490 window_handle, | 489 window_handle, |
491 delegate)); | 490 delegate)); |
492 } | 491 } |
493 | 492 |
494 } // namespace metro_driver | 493 } // namespace metro_driver |
OLD | NEW |