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 #ifndef UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 5 #ifndef UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "ui/aura/window_tree_host.h" | 13 #include "ui/aura/window_tree_host.h" |
14 #include "ui/base/ime/remote_input_method_delegate_win.h" | 14 #include "ui/base/ime/remote_input_method_delegate_win.h" |
15 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
16 #include "ui/events/event_constants.h" | 16 #include "ui/events/event_constants.h" |
| 17 #include "ui/events/event_source.h" |
17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
18 #include "ui/metro_viewer/ime_types.h" | 19 #include "ui/metro_viewer/ime_types.h" |
19 | 20 |
20 struct MetroViewerHostMsg_MouseButtonParams; | 21 struct MetroViewerHostMsg_MouseButtonParams; |
21 | 22 |
22 namespace base { | 23 namespace base { |
23 class FilePath; | 24 class FilePath; |
24 } | 25 } |
25 | 26 |
26 namespace ui { | 27 namespace ui { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 // Handles the metro exit command. Notifies the metro viewer to shutdown | 97 // Handles the metro exit command. Notifies the metro viewer to shutdown |
97 // gracefully. | 98 // gracefully. |
98 AURA_EXPORT void HandleMetroExit(); | 99 AURA_EXPORT void HandleMetroExit(); |
99 | 100 |
100 // WindowTreeHost implementaton that receives events from a different | 101 // WindowTreeHost implementaton that receives events from a different |
101 // process. In the case of Windows this is the Windows 8 (aka Metro) | 102 // process. In the case of Windows this is the Windows 8 (aka Metro) |
102 // frontend process, which forwards input events to this class. | 103 // frontend process, which forwards input events to this class. |
103 class AURA_EXPORT RemoteWindowTreeHostWin | 104 class AURA_EXPORT RemoteWindowTreeHostWin |
104 : public WindowTreeHost, | 105 : public WindowTreeHost, |
| 106 public ui::EventSource, |
105 public ui::internal::RemoteInputMethodDelegateWin { | 107 public ui::internal::RemoteInputMethodDelegateWin { |
106 public: | 108 public: |
107 // Returns the only RemoteWindowTreeHostWin, if this is the first time | 109 // Returns the only RemoteWindowTreeHostWin, if this is the first time |
108 // this function is called, it will call Create() wiht empty bounds. | 110 // this function is called, it will call Create() wiht empty bounds. |
109 static RemoteWindowTreeHostWin* Instance(); | 111 static RemoteWindowTreeHostWin* Instance(); |
110 static RemoteWindowTreeHostWin* Create(const gfx::Rect& bounds); | 112 static RemoteWindowTreeHostWin* Create(const gfx::Rect& bounds); |
111 | 113 |
112 // Sets the handle to the remote window. The |remote_window| is the actual | 114 // Sets the handle to the remote window. The |remote_window| is the actual |
113 // window owned by the viewer process. Call this before Connected() for some | 115 // window owned by the viewer process. Call this before Connected() for some |
114 // customers like input method initialization which needs the handle. | 116 // customers like input method initialization which needs the handle. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 226 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
225 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 227 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
226 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 228 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
227 virtual void UnConfineCursor() OVERRIDE; | 229 virtual void UnConfineCursor() OVERRIDE; |
228 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 230 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
229 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 231 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
230 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 232 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
231 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 233 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
232 virtual void PrepareForShutdown() OVERRIDE; | 234 virtual void PrepareForShutdown() OVERRIDE; |
233 | 235 |
| 236 // ui::EventSource: |
| 237 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
| 238 |
234 // ui::internal::RemoteInputMethodDelegateWin overrides: | 239 // ui::internal::RemoteInputMethodDelegateWin overrides: |
235 virtual void CancelComposition() OVERRIDE; | 240 virtual void CancelComposition() OVERRIDE; |
236 virtual void OnTextInputClientUpdated( | 241 virtual void OnTextInputClientUpdated( |
237 const std::vector<int32>& input_scopes, | 242 const std::vector<int32>& input_scopes, |
238 const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE; | 243 const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE; |
239 | 244 |
240 // Helper function to dispatch a keyboard message to the desired target. | 245 // Helper function to dispatch a keyboard message to the desired target. |
241 // The default target is the WindowTreeHostDelegate. For nested message loop | 246 // The default target is the WindowTreeHostDelegate. For nested message loop |
242 // invocations we post a synthetic keyboard message directly into the message | 247 // invocations we post a synthetic keyboard message directly into the message |
243 // loop. The dispatcher for the nested loop would then decide how this | 248 // loop. The dispatcher for the nested loop would then decide how this |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 295 |
291 // Current size of this root window. | 296 // Current size of this root window. |
292 gfx::Size window_size_; | 297 gfx::Size window_size_; |
293 | 298 |
294 DISALLOW_COPY_AND_ASSIGN(RemoteWindowTreeHostWin); | 299 DISALLOW_COPY_AND_ASSIGN(RemoteWindowTreeHostWin); |
295 }; | 300 }; |
296 | 301 |
297 } // namespace aura | 302 } // namespace aura |
298 | 303 |
299 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 304 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |