| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ | 5 #ifndef CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ |
| 6 #define CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ | 6 #define CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 |
| 10 #include "base/bind.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 11 #include "chrome_frame/sync_msg_reply_dispatcher.h" | 13 #include "chrome_frame/sync_msg_reply_dispatcher.h" |
| 12 #include "chrome_frame/chrome_frame_automation.h" | 14 #include "chrome_frame/chrome_frame_automation.h" |
| 13 #include "ipc/ipc_sync_message.h" | 15 #include "ipc/ipc_sync_message.h" |
| 14 | 16 |
| 15 // TODO(ananta) | 17 // TODO(ananta) |
| 16 // Move the implementations of these classes to the source file. | 18 // Move the implementations of these classes to the source file. |
| 17 | 19 |
| 18 // Class that maintains contextual information for the create and connect | 20 // Class that maintains contextual information for the create and connect |
| 19 // external tab operations. | 21 // external tab operations. |
| 20 class CreateExternalTabContext | 22 class CreateExternalTabContext |
| 21 : public SyncMessageReplyDispatcher::SyncMessageCallContext { | 23 : public SyncMessageReplyDispatcher::SyncMessageCallContext { |
| 22 public: | 24 public: |
| 23 typedef Tuple4<HWND, HWND, int, int> output_type; | 25 typedef Tuple4<HWND, HWND, int, int> output_type; |
| 24 explicit CreateExternalTabContext(ChromeFrameAutomationClient* client) | 26 explicit CreateExternalTabContext(ChromeFrameAutomationClient* client) |
| 25 : client_(client) { | 27 : client_(client) { |
| 26 } | 28 } |
| 27 | 29 |
| 28 void Completed(HWND chrome_window, HWND tab_window, int tab_handle, | 30 void Completed(HWND chrome_window, HWND tab_window, int tab_handle, |
| 29 int session_id) { | 31 int session_id) { |
| 30 AutomationLaunchResult launch_result = | 32 AutomationLaunchResult launch_result = |
| 31 client_->CreateExternalTabComplete(chrome_window, tab_window, | 33 client_->CreateExternalTabComplete(chrome_window, tab_window, |
| 32 tab_handle, session_id); | 34 tab_handle, session_id); |
| 33 client_->PostTask(FROM_HERE, | 35 client_->PostTask( |
| 34 NewRunnableMethod( | 36 FROM_HERE, base::Bind(&ChromeFrameAutomationClient::InitializeComplete, |
| 35 client_.get(), | 37 client_.get(), launch_result)); |
| 36 &ChromeFrameAutomationClient::InitializeComplete, | |
| 37 launch_result)); | |
| 38 } | 38 } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 scoped_refptr<ChromeFrameAutomationClient> client_; | 41 scoped_refptr<ChromeFrameAutomationClient> client_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // This class maintains context information for the BeginNavigate operations | 44 // This class maintains context information for the BeginNavigate operations |
| 45 // pertaining to the external tab. | 45 // pertaining to the external tab. |
| 46 class BeginNavigateContext | 46 class BeginNavigateContext |
| 47 : public SyncMessageReplyDispatcher::SyncMessageCallContext { | 47 : public SyncMessageReplyDispatcher::SyncMessageCallContext { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 78 // This object will be destroyed after this. Cannot access any members | 78 // This object will be destroyed after this. Cannot access any members |
| 79 // on returning from this function. | 79 // on returning from this function. |
| 80 } | 80 } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 base::WaitableEvent* unload_done_; | 83 base::WaitableEvent* unload_done_; |
| 84 bool* should_unload_; | 84 bool* should_unload_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ | 87 #endif // CHROME_FRAME_CUSTOM_SYNC_CALL_CONTEXT_H_ |
| OLD | NEW |