Chromium Code Reviews| Index: base/win/text_services_bridge.h |
| diff --git a/base/win/text_services_bridge.h b/base/win/text_services_bridge.h |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..f3b9c594c3de53e0df8696afd0091eed71a5c57d |
| --- /dev/null |
| +++ b/base/win/text_services_bridge.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_WIN_TEXT_SERVICES_BRIDGE_H_ |
| +#define BASE_WIN_TEXT_SERVICES_BRIDGE_H_ |
| + |
| +#include <msctf.h> |
| +#include <Windows.h> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/win/metro.h" |
| +#include "base/win/scoped_com_initializer.h" |
| +#include "base/win/scoped_comptr.h" |
| +#include "base/message_pump_win.h" |
| + |
| +namespace base { |
| +namespace win { |
| + |
| +class TextServicesBridge : public base::MessagePumpForUI::MessageFilter { |
| + public: |
| + TextServicesBridge(); |
| + virtual ~TextServicesBridge(); |
| + virtual bool Init() OVERRIDE; |
| + // Wraps for ITfMessagePump::PeekMessage with win32 PeekMessage signature. |
| + // Obtains messages from application message queue. |
|
rvargas (doing something else)
2012/08/21 19:45:37
These comments belong to the cc file. This is just
yoichio
2012/08/22 08:06:50
Done.
|
| + virtual BOOL DoPeekMessage(MSG* msg, |
| + HWND hwnd, |
| + UINT msg_filter_min, |
| + UINT msg_filter_max, |
| + UINT remove_msg) OVERRIDE; |
| + // Sends msg to Text Service Manager. |
| + // The msg will be used to input composition text. |
| + // Returns true if|msg| was consumed by text service manager. |
| + virtual bool ProcessMessage(const MSG& message) OVERRIDE; |
| + |
| + private: |
| + TfClientId client_id_; |
| + bool is_initialized_; |
| + base::win::ScopedCOMInitializer scoped_com_initialiser_; |
| + base::win::ScopedComPtr<ITfThreadMgr> thread_mgr_; |
| + base::win::ScopedComPtr<ITfMessagePump> message_pump_; |
| + base::win::ScopedComPtr<ITfKeystrokeMgr> keystroke_mgr_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TextServicesBridge); |
| +}; |
| + |
| +} // namespace win |
| +} // namespace base |
| + |
| +#endif // BASE_WIN_TEXT_SERVICES_BRIDGE_H_ |