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 25 matching lines...) Expand all Loading... |
36 OpenMultipleFilesCompletion; | 36 OpenMultipleFilesCompletion; |
37 | 37 |
38 typedef base::Callback<void(const base::FilePath&, int, void*)> | 38 typedef base::Callback<void(const base::FilePath&, int, void*)> |
39 SaveFileCompletion; | 39 SaveFileCompletion; |
40 | 40 |
41 typedef base::Callback<void(const base::FilePath&, int, void*)> | 41 typedef base::Callback<void(const base::FilePath&, int, void*)> |
42 SelectFolderCompletion; | 42 SelectFolderCompletion; |
43 | 43 |
44 // Handles the open file operation for Metro Chrome Ash. The callback passed in | 44 // Handles the open file operation for Metro Chrome Ash. The callback passed in |
45 // is invoked when we receive the opened file name from the metro viewer. | 45 // is invoked when we receive the opened file name from the metro viewer. |
46 AURA_EXPORT void HandleOpenFile( | 46 AURA_EXPORT void HandleOpenFile(const base::string16& title, |
47 const string16& title, | 47 const base::FilePath& default_path, |
48 const base::FilePath& default_path, | 48 const base::string16& filter, |
49 const string16& filter, | 49 const OpenFileCompletion& callback); |
50 const OpenFileCompletion& callback); | |
51 | 50 |
52 // Handles the open multiple file operation for Metro Chrome Ash. The callback | 51 // Handles the open multiple file operation for Metro Chrome Ash. The callback |
53 // passed in is invoked when we receive the opened file names from the metro | 52 // passed in is invoked when we receive the opened file names from the metro |
54 // viewer. | 53 // viewer. |
55 AURA_EXPORT void HandleOpenMultipleFiles( | 54 AURA_EXPORT void HandleOpenMultipleFiles( |
56 const string16& title, | 55 const base::string16& title, |
57 const base::FilePath& default_path, | 56 const base::FilePath& default_path, |
58 const string16& filter, | 57 const base::string16& filter, |
59 const OpenMultipleFilesCompletion& callback); | 58 const OpenMultipleFilesCompletion& callback); |
60 | 59 |
61 // Handles the save file operation for Metro Chrome Ash. The callback passed in | 60 // Handles the save file operation for Metro Chrome Ash. The callback passed in |
62 // is invoked when we receive the saved file name from the metro viewer. | 61 // is invoked when we receive the saved file name from the metro viewer. |
63 AURA_EXPORT void HandleSaveFile( | 62 AURA_EXPORT void HandleSaveFile(const base::string16& title, |
64 const string16& title, | 63 const base::FilePath& default_path, |
65 const base::FilePath& default_path, | 64 const base::string16& filter, |
66 const string16& filter, | 65 int filter_index, |
67 int filter_index, | 66 const base::string16& default_extension, |
68 const string16& default_extension, | 67 const SaveFileCompletion& callback); |
69 const SaveFileCompletion& callback); | |
70 | 68 |
71 // Handles the select folder for Metro Chrome Ash. The callback passed in | 69 // Handles the select folder for Metro Chrome Ash. The callback passed in |
72 // is invoked when we receive the folder name from the metro viewer. | 70 // is invoked when we receive the folder name from the metro viewer. |
73 AURA_EXPORT void HandleSelectFolder(const string16& title, | 71 AURA_EXPORT void HandleSelectFolder(const base::string16& title, |
74 const SelectFolderCompletion& callback); | 72 const SelectFolderCompletion& callback); |
75 | 73 |
76 // RootWindowHost implementaton that receives events from a different | 74 // RootWindowHost implementaton that receives events from a different |
77 // process. In the case of Windows this is the Windows 8 (aka Metro) | 75 // process. In the case of Windows this is the Windows 8 (aka Metro) |
78 // frontend process, which forwards input events to this class. | 76 // frontend process, which forwards input events to this class. |
79 class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { | 77 class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { |
80 public: | 78 public: |
81 static RemoteRootWindowHostWin* Instance(); | 79 static RemoteRootWindowHostWin* Instance(); |
82 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); | 80 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); |
83 | 81 |
84 // Called when the remote process has established its IPC connection. | 82 // Called when the remote process has established its IPC connection. |
85 // The |host| can be used when we need to send a message to it. | 83 // The |host| can be used when we need to send a message to it. |
86 void Connected(IPC::Sender* host); | 84 void Connected(IPC::Sender* host); |
87 // Called when the remote process has closed its IPC connection. | 85 // Called when the remote process has closed its IPC connection. |
88 void Disconnected(); | 86 void Disconnected(); |
89 | 87 |
90 // Called when we have a message from the remote process. | 88 // Called when we have a message from the remote process. |
91 bool OnMessageReceived(const IPC::Message& message); | 89 bool OnMessageReceived(const IPC::Message& message); |
92 | 90 |
93 void HandleOpenFile( | 91 void HandleOpenFile(const base::string16& title, |
94 const string16& title, | 92 const base::FilePath& default_path, |
95 const base::FilePath& default_path, | 93 const base::string16& filter, |
96 const string16& filter, | 94 const OpenFileCompletion& callback); |
97 const OpenFileCompletion& callback); | |
98 | 95 |
99 void HandleOpenMultipleFiles( | 96 void HandleOpenMultipleFiles(const base::string16& title, |
100 const string16& title, | 97 const base::FilePath& default_path, |
101 const base::FilePath& default_path, | 98 const base::string16& filter, |
102 const string16& filter, | 99 const OpenMultipleFilesCompletion& callback); |
103 const OpenMultipleFilesCompletion& callback); | |
104 | 100 |
105 void HandleSaveFile( | 101 void HandleSaveFile(const base::string16& title, |
106 const string16& title, | 102 const base::FilePath& default_path, |
107 const base::FilePath& default_path, | 103 const base::string16& filter, |
108 const string16& filter, | 104 int filter_index, |
109 int filter_index, | 105 const base::string16& default_extension, |
110 const string16& default_extension, | 106 const SaveFileCompletion& callback); |
111 const SaveFileCompletion& callback); | |
112 | 107 |
113 void HandleSelectFolder(const string16& title, | 108 void HandleSelectFolder(const base::string16& title, |
114 const SelectFolderCompletion& callback); | 109 const SelectFolderCompletion& callback); |
115 | 110 |
116 private: | 111 private: |
117 explicit RemoteRootWindowHostWin(const gfx::Rect& bounds); | 112 explicit RemoteRootWindowHostWin(const gfx::Rect& bounds); |
118 virtual ~RemoteRootWindowHostWin(); | 113 virtual ~RemoteRootWindowHostWin(); |
119 | 114 |
120 // IPC message handing methods: | 115 // IPC message handing methods: |
121 void OnMouseMoved(int32 x, int32 y, int32 flags); | 116 void OnMouseMoved(int32 x, int32 y, int32 flags); |
122 void OnMouseButton(int32 x, | 117 void OnMouseButton(int32 x, |
123 int32 y, | 118 int32 y, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // Set to true if we need to ignore mouse messages until the SetCursorPos | 198 // Set to true if we need to ignore mouse messages until the SetCursorPos |
204 // operation is acked by the viewer. | 199 // operation is acked by the viewer. |
205 bool ignore_mouse_moves_until_set_cursor_ack_; | 200 bool ignore_mouse_moves_until_set_cursor_ack_; |
206 | 201 |
207 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); | 202 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); |
208 }; | 203 }; |
209 | 204 |
210 } // namespace aura | 205 } // namespace aura |
211 | 206 |
212 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 207 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |