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" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // metro viewer. The on failure callback is invoked on failure. | 79 // metro viewer. The on failure callback is invoked on failure. |
80 AURA_EXPORT void HandleSelectFolder(const base::string16& title, | 80 AURA_EXPORT void HandleSelectFolder(const base::string16& title, |
81 const SelectFolderCompletion& on_success, | 81 const SelectFolderCompletion& on_success, |
82 const FileSelectionCanceled& on_failure); | 82 const FileSelectionCanceled& on_failure); |
83 | 83 |
84 // RootWindowHost implementaton that receives events from a different | 84 // RootWindowHost implementaton that receives events from a different |
85 // process. In the case of Windows this is the Windows 8 (aka Metro) | 85 // process. In the case of Windows this is the Windows 8 (aka Metro) |
86 // frontend process, which forwards input events to this class. | 86 // frontend process, which forwards input events to this class. |
87 class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { | 87 class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { |
88 public: | 88 public: |
| 89 // Returns the only RemoteRootWindowHostWin, if this is the first time |
| 90 // this function is called, it will call Create() wiht empty bounds. |
89 static RemoteRootWindowHostWin* Instance(); | 91 static RemoteRootWindowHostWin* Instance(); |
90 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); | 92 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); |
91 | 93 |
92 // Called when the remote process has established its IPC connection. | 94 // Called when the remote process has established its IPC connection. |
93 // The |host| can be used when we need to send a message to it. | 95 // The |host| can be used when we need to send a message to it and |
94 void Connected(IPC::Sender* host); | 96 // |remote_window| is the actual window owned by the viewer process. |
| 97 void Connected(IPC::Sender* host, HWND remote_window); |
95 // Called when the remote process has closed its IPC connection. | 98 // Called when the remote process has closed its IPC connection. |
96 void Disconnected(); | 99 void Disconnected(); |
97 | 100 |
98 // Called when we have a message from the remote process. | 101 // Called when we have a message from the remote process. |
99 bool OnMessageReceived(const IPC::Message& message); | 102 bool OnMessageReceived(const IPC::Message& message); |
100 | 103 |
101 void HandleOpenFile(const base::string16& title, | 104 void HandleOpenFile(const base::string16& title, |
102 const base::FilePath& default_path, | 105 const base::FilePath& default_path, |
103 const base::string16& filter, | 106 const base::string16& filter, |
104 const OpenFileCompletion& on_success, | 107 const OpenFileCompletion& on_success, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // invocations we post a synthetic keyboard message directly into the message | 199 // invocations we post a synthetic keyboard message directly into the message |
197 // loop. The dispatcher for the nested loop would then decide how this | 200 // loop. The dispatcher for the nested loop would then decide how this |
198 // message is routed. | 201 // message is routed. |
199 void DispatchKeyboardMessage(ui::EventType type, | 202 void DispatchKeyboardMessage(ui::EventType type, |
200 uint32 vkey, | 203 uint32 vkey, |
201 uint32 repeat_count, | 204 uint32 repeat_count, |
202 uint32 scan_code, | 205 uint32 scan_code, |
203 uint32 flags, | 206 uint32 flags, |
204 bool is_character); | 207 bool is_character); |
205 | 208 |
| 209 HWND remote_window_; |
206 RootWindowHostDelegate* delegate_; | 210 RootWindowHostDelegate* delegate_; |
207 IPC::Sender* host_; | 211 IPC::Sender* host_; |
208 scoped_ptr<ui::ViewProp> prop_; | 212 scoped_ptr<ui::ViewProp> prop_; |
209 | 213 |
210 // Saved callbacks which inform the caller about the result of the open file/ | 214 // Saved callbacks which inform the caller about the result of the open file/ |
211 // save file/select operations. | 215 // save file/select operations. |
212 OpenFileCompletion file_open_completion_callback_; | 216 OpenFileCompletion file_open_completion_callback_; |
213 OpenMultipleFilesCompletion multi_file_open_completion_callback_; | 217 OpenMultipleFilesCompletion multi_file_open_completion_callback_; |
214 SaveFileCompletion file_saveas_completion_callback_; | 218 SaveFileCompletion file_saveas_completion_callback_; |
215 SelectFolderCompletion select_folder_completion_callback_; | 219 SelectFolderCompletion select_folder_completion_callback_; |
216 FileSelectionCanceled failure_callback_; | 220 FileSelectionCanceled failure_callback_; |
217 | 221 |
218 // Set to true if we need to ignore mouse messages until the SetCursorPos | 222 // Set to true if we need to ignore mouse messages until the SetCursorPos |
219 // operation is acked by the viewer. | 223 // operation is acked by the viewer. |
220 bool ignore_mouse_moves_until_set_cursor_ack_; | 224 bool ignore_mouse_moves_until_set_cursor_ack_; |
221 | 225 |
222 // Tracking last click event for synthetically generated mouse events. | 226 // Tracking last click event for synthetically generated mouse events. |
223 scoped_ptr<ui::MouseEvent> last_mouse_click_event_; | 227 scoped_ptr<ui::MouseEvent> last_mouse_click_event_; |
224 | 228 |
225 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); | 229 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); |
226 }; | 230 }; |
227 | 231 |
228 } // namespace aura | 232 } // namespace aura |
229 | 233 |
230 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 234 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |