summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_frame_automation.cc12
-rw-r--r--chrome_frame/chrome_frame_automation.h5
-rw-r--r--chrome_frame/custom_sync_call_context.h8
3 files changed, 12 insertions, 13 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index d4bca94..257e20b 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -832,8 +832,6 @@ void ChromeFrameAutomationClient::CreateExternalTabComplete(HWND chrome_window,
tab_->AddObserver(this);
tab_handle_ = tab_handle;
}
-
- InitializeComplete(launch_result);
}
void ChromeFrameAutomationClient::SetEnableExtensionAutomation(
@@ -1100,19 +1098,21 @@ void ChromeFrameAutomationClient::ReleaseAutomationServer() {
// calling ReleaseAutomationServer. The reason we do this is that
// we must cancel pending messages before we release the automation server.
// Furthermore, while ReleaseAutomationServer is running, we could get
- // a callback to LaunchComplete which is where we normally get our pointer
- // to the automation server and there we check the server id for NULLness
- // and do nothing if it is NULL.
+ // a callback to LaunchComplete which could cause an external tab to be
+ // created. Ideally the callbacks should be dropped.
+ // TODO(ananta)
+ // Refactor the ChromeFrameAutomationProxy code to not depend on
+ // AutomationProxy and simplify the whole mess.
void* server_id = automation_server_id_;
automation_server_id_ = NULL;
if (automation_server_) {
// Make sure to clean up any pending sync messages before we go away.
automation_server_->CancelAsync(this);
- automation_server_ = NULL;
}
proxy_factory_->ReleaseAutomationServer(server_id);
+ automation_server_ = NULL;
// automation_server_ must not have been set to non NULL.
// (if this regresses, start by looking at LaunchComplete()).
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h
index 3461eba2..78e1d30 100644
--- a/chrome_frame/chrome_frame_automation.h
+++ b/chrome_frame/chrome_frame_automation.h
@@ -273,10 +273,6 @@ class ChromeFrameAutomationClient
// For IDeleteBrowsingHistorySupport
void RemoveBrowsingData(int remove_mask);
- ChromeFrameAutomationProxy* automation_server() {
- return automation_server_;
- }
-
protected:
// ChromeFrameAutomationProxy::LaunchDelegate implementation.
virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy,
@@ -316,6 +312,7 @@ class ChromeFrameAutomationClient
void* automation_server_id_;
ChromeFrameAutomationProxy* automation_server_;
+
HWND chrome_window_;
scoped_refptr<TabProxy> tab_;
ChromeFrameDelegate* chrome_frame_delegate_;
diff --git a/chrome_frame/custom_sync_call_context.h b/chrome_frame/custom_sync_call_context.h
index fcb786a..c9242d6 100644
--- a/chrome_frame/custom_sync_call_context.h
+++ b/chrome_frame/custom_sync_call_context.h
@@ -90,10 +90,12 @@ class CreateExternalTabContext
}
void Completed(HWND chrome_window, HWND tab_window, int tab_handle) {
+ client_->CreateExternalTabComplete(chrome_window, tab_window, tab_handle);
client_->PostTask(FROM_HERE,
- NewRunnableMethod(client_.get(),
- &ChromeFrameAutomationClient::CreateExternalTabComplete,
- chrome_window, tab_window, tab_handle));
+ NewRunnableMethod(
+ client_.get(),
+ &ChromeFrameAutomationClient::InitializeComplete,
+ AUTOMATION_SUCCESS));
}
private: