1 // Copyright (c) 2011 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 CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_
6 #define CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_
10 #include "base/memory/ref_counted.h"
11 #include "base/synchronization/waitable_event.h"
12 #include "base/tuple.h"
13 #include "chrome_frame/sync_msg_reply_dispatcher.h"
14 #include "chrome_frame/chrome_frame_automation.h"
15 #include "ipc/ipc_sync_message.h"
17 // Class that maintains contextual information for the create and connect
18 // external tab operations.
19 class CreateExternalTabContext
20 : public SyncMessageReplyDispatcher::SyncMessageCallContext
{
22 typedef Tuple4
<HWND
, HWND
, int, int> output_type
;
23 explicit CreateExternalTabContext(ChromeFrameAutomationClient
* client
);
25 void Completed(HWND chrome_window
, HWND tab_window
, int tab_handle
,
29 scoped_refptr
<ChromeFrameAutomationClient
> client_
;
32 // This class maintains context information for the BeginNavigate operations
33 // pertaining to the external tab.
34 class BeginNavigateContext
35 : public SyncMessageReplyDispatcher::SyncMessageCallContext
{
37 explicit BeginNavigateContext(ChromeFrameAutomationClient
* client
);
39 typedef Tuple1
<AutomationMsg_NavigationResponseValues
> output_type
;
41 void Completed(AutomationMsg_NavigationResponseValues response
);
44 scoped_refptr
<ChromeFrameAutomationClient
> client_
;
47 // Class that maintains contextual information for the unload operation, i.e.
48 // when the user attempts to navigate away from a page rendered in ChromeFrame.
50 : public SyncMessageReplyDispatcher::SyncMessageCallContext
{
52 typedef Tuple1
<bool> output_type
;
53 UnloadContext(base::WaitableEvent
* unload_done
, bool* should_unload
);
55 void Completed(bool should_unload
);
58 base::WaitableEvent
* unload_done_
;
62 #endif // CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_