blob: 58b9c5a3ac16b8060c1e959798da87971614f5e0 [file] [log] [blame]
[email protected]3b63f8f42011-03-28 01:54:151// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]d0b8e5f2010-05-18 04:26:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
[email protected]44f9c952011-01-02 06:05:394
[email protected]d0b8e5f2010-05-18 04:26:025#ifndef CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_
6#define CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_
7
8#include <vector>
[email protected]bb04c4e2011-11-18 20:44:229
[email protected]3b63f8f42011-03-28 01:54:1510#include "base/memory/ref_counted.h"
[email protected]44f9c952011-01-02 06:05:3911#include "base/synchronization/waitable_event.h"
[email protected]c6944272012-01-06 22:12:2812#include "base/tuple.h"
[email protected]d0b8e5f2010-05-18 04:26:0213#include "chrome_frame/sync_msg_reply_dispatcher.h"
14#include "chrome_frame/chrome_frame_automation.h"
15#include "ipc/ipc_sync_message.h"
16
[email protected]d0b8e5f2010-05-18 04:26:0217// Class that maintains contextual information for the create and connect
18// external tab operations.
19class CreateExternalTabContext
20 : public SyncMessageReplyDispatcher::SyncMessageCallContext {
21 public:
[email protected]751bf4b2010-11-05 22:06:3122 typedef Tuple4<HWND, HWND, int, int> output_type;
[email protected]a1e41bb2011-12-21 21:01:2123 explicit CreateExternalTabContext(ChromeFrameAutomationClient* client);
[email protected]d0b8e5f2010-05-18 04:26:0224
[email protected]751bf4b2010-11-05 22:06:3125 void Completed(HWND chrome_window, HWND tab_window, int tab_handle,
[email protected]a1e41bb2011-12-21 21:01:2126 int session_id);
[email protected]d0b8e5f2010-05-18 04:26:0227
28 private:
29 scoped_refptr<ChromeFrameAutomationClient> client_;
30};
31
32// This class maintains context information for the BeginNavigate operations
33// pertaining to the external tab.
34class BeginNavigateContext
35 : public SyncMessageReplyDispatcher::SyncMessageCallContext {
36 public:
[email protected]a1e41bb2011-12-21 21:01:2137 explicit BeginNavigateContext(ChromeFrameAutomationClient* client);
[email protected]d0b8e5f2010-05-18 04:26:0238
39 typedef Tuple1<AutomationMsg_NavigationResponseValues> output_type;
40
[email protected]a1e41bb2011-12-21 21:01:2141 void Completed(AutomationMsg_NavigationResponseValues response);
[email protected]d0b8e5f2010-05-18 04:26:0242
43 private:
44 scoped_refptr<ChromeFrameAutomationClient> client_;
45};
46
[email protected]d9d8f0c2010-09-17 21:47:1647// 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.
49class UnloadContext
50 : public SyncMessageReplyDispatcher::SyncMessageCallContext {
51 public:
52 typedef Tuple1<bool> output_type;
[email protected]a1e41bb2011-12-21 21:01:2153 UnloadContext(base::WaitableEvent* unload_done, bool* should_unload);
[email protected]d9d8f0c2010-09-17 21:47:1654
[email protected]a1e41bb2011-12-21 21:01:2155 void Completed(bool should_unload);
[email protected]d9d8f0c2010-09-17 21:47:1656
57 private:
58 base::WaitableEvent* unload_done_;
59 bool* should_unload_;
60};
61
[email protected]d0b8e5f2010-05-18 04:26:0262#endif // CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_