OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 5 #ifndef WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
6 #define WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 6 #define WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 base::ProcessId GetViewerProcessId(); | 63 base::ProcessId GetViewerProcessId(); |
64 | 64 |
65 // Launches the viewer process associated with the given |app_user_model_id| | 65 // Launches the viewer process associated with the given |app_user_model_id| |
66 // and blocks until that viewer process connects or until a timeout is | 66 // and blocks until that viewer process connects or until a timeout is |
67 // reached. Returns true if the viewer process connects before the timeout is | 67 // reached. Returns true if the viewer process connects before the timeout is |
68 // reached. NOTE: this assumes that the app referred to by |app_user_model_id| | 68 // reached. NOTE: this assumes that the app referred to by |app_user_model_id| |
69 // is registered as the default browser. | 69 // is registered as the default browser. |
70 bool LaunchViewerAndWaitForConnection( | 70 bool LaunchViewerAndWaitForConnection( |
71 const base::string16& app_user_model_id); | 71 const base::string16& app_user_model_id); |
72 | 72 |
| 73 // Same as above, except flags that we're launching for running tests. This |
| 74 // causes more aggressive termination when shutting down the viewer. |
| 75 bool LaunchViewerAndWaitForConnectionForTests( |
| 76 const base::string16& app_user_model_id); |
| 77 |
73 // Handles the activate desktop command for Metro Chrome Ash. The |ash_exit| | 78 // Handles the activate desktop command for Metro Chrome Ash. The |ash_exit| |
74 // parameter indicates whether the Ash process would be shutdown after | 79 // parameter indicates whether the Ash process would be shutdown after |
75 // activating the desktop. | 80 // activating the desktop. |
76 static void HandleActivateDesktop(const base::FilePath& shortcut, | 81 static void HandleActivateDesktop(const base::FilePath& shortcut, |
77 bool ash_exit); | 82 bool ash_exit); |
78 | 83 |
79 // Handles the metro exit command. Notifies the metro viewer to shutdown | 84 // Handles the metro exit command. Notifies the metro viewer to shutdown |
80 // gracefully. | 85 // gracefully. |
81 static void HandleMetroExit(); | 86 static void HandleMetroExit(); |
82 | 87 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 static MetroViewerProcessHost* instance_; | 206 static MetroViewerProcessHost* instance_; |
202 | 207 |
203 // Saved callbacks which inform the caller about the result of the open file/ | 208 // Saved callbacks which inform the caller about the result of the open file/ |
204 // save file/select operations. | 209 // save file/select operations. |
205 OpenFileCompletion file_open_completion_callback_; | 210 OpenFileCompletion file_open_completion_callback_; |
206 OpenMultipleFilesCompletion multi_file_open_completion_callback_; | 211 OpenMultipleFilesCompletion multi_file_open_completion_callback_; |
207 SaveFileCompletion file_saveas_completion_callback_; | 212 SaveFileCompletion file_saveas_completion_callback_; |
208 SelectFolderCompletion select_folder_completion_callback_; | 213 SelectFolderCompletion select_folder_completion_callback_; |
209 FileSelectionCanceled failure_callback_; | 214 FileSelectionCanceled failure_callback_; |
210 | 215 |
| 216 // Whether LaunchViewerAndWaitForConnection was for test binaries. In tests, |
| 217 // we are more aggressive in terminating the viewer so that it can |
| 218 // immediately be relaunched for the next test. |
| 219 bool launched_for_test_; |
| 220 |
211 DISALLOW_COPY_AND_ASSIGN(MetroViewerProcessHost); | 221 DISALLOW_COPY_AND_ASSIGN(MetroViewerProcessHost); |
212 }; | 222 }; |
213 | 223 |
214 } // namespace win8 | 224 } // namespace win8 |
215 | 225 |
216 #endif // WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 226 #endif // WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
OLD | NEW |