| 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_TEST_OPEN_WITH_DIALOG_ASYNC_H_ | 5 #ifndef WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_ |
| 6 #define WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_ | 6 #define WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 | 12 |
| 13 namespace win8 { | 13 namespace win8 { |
| 14 | 14 |
| 15 // Expected HRESULTS: | 15 // Expected HRESULTS: |
| 16 // S_OK - A choice was made. | 16 // S_OK - A choice was made. |
| 17 // HRESULT_FROM_WIN32(ERROR_CANCELLED) - The dialog was dismissed. | 17 // HRESULT_FROM_WIN32(ERROR_CANCELLED) - The dialog was dismissed. |
| 18 // HRESULT_FROM_WIN32(RPC_S_CALL_FAILED) - OpenWith.exe died. | 18 // HRESULT_FROM_WIN32(RPC_S_CALL_FAILED) - OpenWith.exe died. |
| 19 typedef base::Callback<void(HRESULT)> OpenWithDialogCallback; | 19 typedef base::Callback<void(HRESULT)> OpenWithDialogCallback; |
| 20 | 20 |
| 21 // Calls SHOpenWithDialog on a dedicated thread, returning the result to the | 21 // Calls SHOpenWithDialog on a dedicated thread, returning the result to the |
| 22 // caller via |callback| on the current thread. The Windows SHOpenWithDialog | 22 // caller via |callback| on the current thread. The Windows SHOpenWithDialog |
| 23 // function blocks until the user makes a choice or dismisses the dialog (there | 23 // function blocks until the user makes a choice or dismisses the dialog (there |
| 24 // is no natural timeout nor a means by which it can be cancelled). Note that | 24 // is no natural timeout nor a means by which it can be cancelled). Note that |
| 25 // the dedicated thread will be leaked if the calling thread's message loop goes | 25 // the dedicated thread will be leaked if the calling thread's message loop goes |
| 26 // away before the interaction completes. | 26 // away before the interaction completes. |
| 27 void OpenWithDialogAsync(HWND parent_window, | 27 void OpenWithDialogAsync(HWND parent_window, |
| 28 const string16& file_name, | 28 const base::string16& file_name, |
| 29 const string16& file_type_class, | 29 const base::string16& file_type_class, |
| 30 int open_as_info_flags, | 30 int open_as_info_flags, |
| 31 const OpenWithDialogCallback& callback); | 31 const OpenWithDialogCallback& callback); |
| 32 | 32 |
| 33 } // namespace win8 | 33 } // namespace win8 |
| 34 | 34 |
| 35 #endif // WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_ | 35 #endif // WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_ |
| OLD | NEW |