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

Side by Side Diff: base/win/text_services_bridge.h

Issue 10826223: Replace PeekMessage for TSF awareness (Closed) Base URL: http://git.chromium.org/chromium/src.git@yukawa
Patch Set: add MessageFilter interface Created 8 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_WIN_TEXT_SERVICES_BRIDGE_H_
6 #define BASE_WIN_TEXT_SERVICES_BRIDGE_H_
7
8 #include <msctf.h>
9 #include <Windows.h>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "base/win/metro.h"
13 #include "base/win/scoped_com_initializer.h"
14 #include "base/win/scoped_comptr.h"
15 #include "base/message_pump_win.h"
16
17 namespace base {
18 namespace win {
19
20 class TextServicesBridge : public base::MessagePumpForUI::MessageFilter {
21 public:
22 TextServicesBridge();
23 virtual ~TextServicesBridge();
24 virtual bool Init() OVERRIDE;
25 // Wraps for ITfMessagePump::PeekMessage with win32 PeekMessage signature.
26 // 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.
27 virtual BOOL DoPeekMessage(MSG* msg,
28 HWND hwnd,
29 UINT msg_filter_min,
30 UINT msg_filter_max,
31 UINT remove_msg) OVERRIDE;
32 // Sends msg to Text Service Manager.
33 // The msg will be used to input composition text.
34 // Returns true if|msg| was consumed by text service manager.
35 virtual bool ProcessMessage(const MSG& message) OVERRIDE;
36
37 private:
38 TfClientId client_id_;
39 bool is_initialized_;
40 base::win::ScopedCOMInitializer scoped_com_initialiser_;
41 base::win::ScopedComPtr<ITfThreadMgr> thread_mgr_;
42 base::win::ScopedComPtr<ITfMessagePump> message_pump_;
43 base::win::ScopedComPtr<ITfKeystrokeMgr> keystroke_mgr_;
44
45 DISALLOW_COPY_AND_ASSIGN(TextServicesBridge);
46 };
47
48 } // namespace win
49 } // namespace base
50
51 #endif // BASE_WIN_TEXT_SERVICES_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698