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

Side by Side Diff: ui/aura/desktop_host_win.h

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git mv desktop_host_unittest.cc desktop_host_ime_unittest.cc Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_AURA_DESKTOP_HOST_WIN_H_ 5 #ifndef UI_AURA_DESKTOP_HOST_WIN_H_
6 #define UI_AURA_DESKTOP_HOST_WIN_H_ 6 #define UI_AURA_DESKTOP_HOST_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/desktop_host.h" 11 #include "ui/aura/desktop_host.h"
11 #include "ui/base/win/window_impl.h" 12 #include "ui/base/win/window_impl.h"
12 13
14 namespace ui {
15 class InputMethod;
16 } // namespace ui
17
13 namespace aura { 18 namespace aura {
14 19
15 class DesktopHostWin : public DesktopHost, public ui::WindowImpl { 20 class DesktopHostWin : public DesktopHost,
21 public ui::WindowImpl {
16 public: 22 public:
17 explicit DesktopHostWin(const gfx::Rect& bounds); 23 explicit DesktopHostWin(const gfx::Rect& bounds);
18 virtual ~DesktopHostWin(); 24 virtual ~DesktopHostWin();
19 25
20 // MessageLoop::Dispatcher: 26 // MessageLoop::Dispatcher:
21 virtual bool Dispatch(const MSG& msg); 27 virtual bool Dispatch(const MSG& msg);
22 28
23 // DesktopHost: 29 // DesktopHost:
24 virtual void SetDesktop(Desktop* desktop) OVERRIDE; 30 virtual void SetDesktop(Desktop* desktop) OVERRIDE;
25 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; 31 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
26 virtual void Show() OVERRIDE; 32 virtual void Show() OVERRIDE;
27 virtual void ToggleFullScreen() OVERRIDE; 33 virtual void ToggleFullScreen() OVERRIDE;
28 virtual gfx::Size GetSize() const OVERRIDE; 34 virtual gfx::Size GetSize() const OVERRIDE;
29 virtual void SetSize(const gfx::Size& size) OVERRIDE; 35 virtual void SetSize(const gfx::Size& size) OVERRIDE;
30 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; 36 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
31 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; 37 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
32 virtual gfx::Point QueryMouseLocation() OVERRIDE; 38 virtual gfx::Point QueryMouseLocation() OVERRIDE;
33 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; 39 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
34 40
41 virtual void SetInputMethod(ui::InputMethod* input_method) OVERRIDE;
42 virtual ui::InputMethod* GetInputMethod() const OVERRIDE;
43
44 // ui::internal::InputMethodDelegate Override.
45 virtual void DispatchKeyEventPostIME(const base::NativeEvent& event) OVERRIDE;
46 virtual void DispatchFabricatedKeyEventPostIME(
47 ui::EventType type, ui::KeyboardCode key_code, int flags) OVERRIDE;
48
35 private: 49 private:
36 BEGIN_MSG_MAP_EX(DesktopHostWin) 50 BEGIN_MSG_MAP_EX(DesktopHostWin)
37 // Range handlers must go first! 51 // Range handlers must go first!
38 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) 52 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange)
39 MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCXBUTTONDBLCLK, OnMouseRange) 53 MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCXBUTTONDBLCLK, OnMouseRange)
40 54
41 // Key events. 55 // Key events.
42 MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyEvent) 56 MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyEvent)
43 MESSAGE_HANDLER_EX(WM_KEYUP, OnKeyEvent) 57 MESSAGE_HANDLER_EX(WM_KEYUP, OnKeyEvent)
44 MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyEvent) 58 MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyEvent)
45 MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyEvent) 59 MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyEvent)
46 MESSAGE_HANDLER_EX(WM_CHAR, OnKeyEvent) 60 MESSAGE_HANDLER_EX(WM_CHAR, OnKeyEvent)
47 MESSAGE_HANDLER_EX(WM_SYSCHAR, OnKeyEvent) 61 MESSAGE_HANDLER_EX(WM_SYSCHAR, OnKeyEvent)
48 MESSAGE_HANDLER_EX(WM_IME_CHAR, OnKeyEvent) 62 MESSAGE_HANDLER_EX(WM_IME_CHAR, OnKeyEvent)
49 63
50 MSG_WM_CLOSE(OnClose) 64 MSG_WM_CLOSE(OnClose)
51 MSG_WM_PAINT(OnPaint) 65 MSG_WM_PAINT(OnPaint)
52 MSG_WM_SIZE(OnSize) 66 MSG_WM_SIZE(OnSize)
53 END_MSG_MAP() 67 END_MSG_MAP()
54 68
55 void OnClose(); 69 void OnClose();
56 LRESULT OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param); 70 LRESULT OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param);
57 LRESULT OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param); 71 LRESULT OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param);
58 void OnPaint(HDC dc); 72 void OnPaint(HDC dc);
59 void OnSize(UINT param, const CSize& size); 73 void OnSize(UINT param, const CSize& size);
60 74
61 Desktop* desktop_; 75 Desktop* desktop_;
62 76
77 scoped_ptr<ui::InputMethod> input_method_;
78
63 bool fullscreen_; 79 bool fullscreen_;
64 RECT saved_window_rect_; 80 RECT saved_window_rect_;
65 DWORD saved_window_style_; 81 DWORD saved_window_style_;
66 DWORD saved_window_ex_style_; 82 DWORD saved_window_ex_style_;
67 83
68 DISALLOW_COPY_AND_ASSIGN(DesktopHostWin); 84 DISALLOW_COPY_AND_ASSIGN(DesktopHostWin);
69 }; 85 };
70 86
71 } // namespace aura 87 } // namespace aura
72 88
73 #endif // UI_AURA_DESKTOP_HOST_WIN_H_ 89 #endif // UI_AURA_DESKTOP_HOST_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698