Update V8 to version 4.7.56.
[chromium-blink-merge.git] / win8 / test / open_with_dialog_async.h
blob62ddbed01ce1044b8aa538af7c5849eaf5a06967
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_
8 #include <windows.h>
10 #include "base/callback_forward.h"
11 #include "base/strings/string16.h"
13 namespace win8 {
15 // Expected HRESULTS:
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);
33 } // namespace win8
35 #endif // WIN8_TEST_OPEN_WITH_DIALOG_ASYNC_H_