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
3 // found in the LICENSE file.
5 #ifndef WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_
6 #define WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_
10 #include "base/callback_forward.h"
11 #include "base/strings/string16.h"
16 // S_OK - A choice was made.
17 // HRESULT_FROM_WIN32(ERROR_CANCELLED) - The dialog was dismissed.
18 // HRESULT_FROM_WIN32(RPC_S_CALL_FAILED) - OpenWith.exe died.
19 typedef base::Callback
<void(HRESULT
)> OpenWithDialogCallback
;
21 // Calls SHOpenWithDialog on a dedicated thread, returning the result to the
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
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
26 // away before the interaction completes.
27 void OpenWithDialogAsync(HWND parent_window
,
28 const base::string16
& file_name
,
29 const base::string16
& file_type_class
,
30 int open_as_info_flags
,
31 const OpenWithDialogCallback
& callback
);
35 #endif // WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_