Index: chrome_frame/chrome_frame_automation.cc |
=================================================================== |
--- chrome_frame/chrome_frame_automation.cc (revision 69966) |
+++ chrome_frame/chrome_frame_automation.cc (working copy) |
@@ -67,17 +67,17 @@ |
if (message.is_reply()) |
return false; |
- int tab_handle = 0; |
- if (!ChromeFrameDelegateImpl::IsTabMessage(message, &tab_handle)) |
+ if (!ChromeFrameDelegateImpl::IsTabMessage(message)) |
return false; |
// Get AddRef-ed pointer to corresponding TabProxy object |
- TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource(tab_handle)); |
+ TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource( |
+ message.routing_id())); |
if (tab) { |
tab->OnMessageReceived(message); |
tab->Release(); |
} else { |
- DLOG(ERROR) << "Failed to find TabProxy for tab:" << tab_handle; |
+ DLOG(ERROR) << "Failed to find TabProxy for tab:" << message.routing_id(); |
} |
return true; |
} |
@@ -442,7 +442,7 @@ |
snapshots_->GatherAllHistograms(); |
if (!histograms.empty()) { |
- proxy_->Send(new AutomationMsg_RecordHistograms(0, histograms)); |
+ proxy_->Send(new AutomationMsg_RecordHistograms(histograms)); |
} |
MessageLoop::current()->PostDelayedTask(FROM_HERE, |
@@ -757,7 +757,7 @@ |
DCHECK(::IsWindow(chrome_window_)); |
IPC::SyncMessage* msg = new AutomationMsg_NavigateExternalTabAtIndex( |
- 0, tab_->handle(), index, NULL); |
+ tab_->handle(), index, NULL); |
automation_server_->SendAsAsync(msg, new BeginNavigateContext(this), |
this); |
return true; |
@@ -799,7 +799,7 @@ |
} |
IPC::SyncMessage* msg = |
- new AutomationMsg_NavigateInExternalTab(0, tab_->handle(), |
+ new AutomationMsg_NavigateInExternalTab(tab_->handle(), |
chrome_launch_params_->url(), chrome_launch_params_->referrer(), |
NULL); |
automation_server_->SendAsAsync(msg, new BeginNavigateContext(this), this); |
@@ -835,7 +835,7 @@ |
params.forward = (forward == FWD); |
IPC::SyncMessage* msg = |
- new AutomationMsg_Find(0, tab_->handle(), params, NULL, NULL); |
+ new AutomationMsg_Find(tab_->handle(), params, NULL, NULL); |
automation_server_->SendAsAsync(msg, NULL, this); |
} |
@@ -852,8 +852,7 @@ |
InstallExtensionContext* ctx = new InstallExtensionContext( |
this, crx_path, user_data); |
- IPC::SyncMessage* msg = |
- new AutomationMsg_InstallExtension(0, crx_path, NULL); |
+ IPC::SyncMessage* msg = new AutomationMsg_InstallExtension(crx_path, NULL); |
// The context will delete itself after it is called. |
automation_server_->SendAsAsync(msg, ctx, this); |
@@ -880,7 +879,7 @@ |
this, user_data); |
IPC::SyncMessage* msg = new AutomationMsg_GetEnabledExtensions( |
- 0, ctx->extension_directories()); |
+ ctx->extension_directories()); |
// The context will delete itself after it is called. |
automation_server_->SendAsAsync(msg, ctx, this); |
@@ -927,8 +926,7 @@ |
InstallExtensionContext* ctx = new InstallExtensionContext( |
this, path, user_data); |
- IPC::SyncMessage* msg = |
- new AutomationMsg_LoadExpandedExtension(0, path, NULL); |
+ IPC::SyncMessage* msg = new AutomationMsg_LoadExpandedExtension(path, NULL); |
// The context will delete itself after it is called. |
automation_server_->SendAsAsync(msg, ctx, this); |
@@ -943,7 +941,7 @@ |
navigate_after_initialization_ = false; |
} |
- const IPC::ExternalTabSettings settings( |
+ const ExternalTabSettings settings( |
m_hWnd, |
gfx::Rect(), |
WS_CHILD, |
@@ -964,7 +962,7 @@ |
2); |
IPC::SyncMessage* message = |
- new AutomationMsg_CreateExternalTab(0, settings, NULL, NULL, 0, 0); |
+ new AutomationMsg_CreateExternalTab(settings, NULL, NULL, 0, 0); |
automation_server_->SendAsAsync(message, new CreateExternalTabContext(this), |
this); |
} |
@@ -1033,7 +1031,7 @@ |
// Send a notification to Chrome that we are ready to connect to the |
// ExternalTab. |
IPC::SyncMessage* message = |
- new AutomationMsg_ConnectExternalTab(0, external_tab_cookie_, true, |
+ new AutomationMsg_ConnectExternalTab(external_tab_cookie_, true, |
m_hWnd, NULL, NULL, NULL, 0); |
automation_server_->SendAsAsync(message, |
new CreateExternalTabContext(this), |
@@ -1369,7 +1367,7 @@ |
void ChromeFrameAutomationClient::BlockExternalTab(uint64 cookie) { |
// The host does not want this tab to be shown (due popup blocker). |
IPC::SyncMessage* message = |
- new AutomationMsg_ConnectExternalTab(0, cookie, false, m_hWnd, |
+ new AutomationMsg_ConnectExternalTab(cookie, false, m_hWnd, |
NULL, NULL, NULL, 0); |
automation_server_->SendAsAsync(message, NULL, this); |
} |
@@ -1384,12 +1382,11 @@ |
} |
automation_server_->Send( |
- new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); |
+ new AutomationMsg_SetPageFontSize(tab_handle_, font_size)); |
} |
void ChromeFrameAutomationClient::RemoveBrowsingData(int remove_mask) { |
- automation_server_->Send( |
- new AutomationMsg_RemoveBrowsingData(0, remove_mask)); |
+ automation_server_->Send(new AutomationMsg_RemoveBrowsingData(remove_mask)); |
} |
void ChromeFrameAutomationClient::SetUrlFetcher( |
@@ -1402,7 +1399,7 @@ |
void ChromeFrameAutomationClient::SetZoomLevel(PageZoom::Function zoom_level) { |
if (automation_server_) { |
- automation_server_->Send(new AutomationMsg_SetZoomLevel(0, tab_handle_, |
+ automation_server_->Send(new AutomationMsg_SetZoomLevel(tab_handle_, |
zoom_level)); |
} |
} |
@@ -1412,7 +1409,7 @@ |
if (automation_server_) { |
const DWORD kUnloadEventTimeout = 20000; |
- IPC::SyncMessage* msg = new AutomationMsg_RunUnloadHandlers(0, tab_handle_, |
+ IPC::SyncMessage* msg = new AutomationMsg_RunUnloadHandlers(tab_handle_, |
should_unload); |
base::WaitableEvent unload_call_finished(false, false); |
UnloadContext* unload_context = new UnloadContext(&unload_call_finished, |
@@ -1431,7 +1428,7 @@ |
const char* mime_type, const char* headers, int size, |
base::Time last_modified, const std::string& redirect_url, |
int redirect_status) { |
- const IPC::AutomationURLResponse response( |
+ const AutomationURLResponse response( |
mime_type, |
headers ? headers : "", |
size, |
@@ -1439,24 +1436,24 @@ |
redirect_url, |
redirect_status); |
- automation_server_->Send(new AutomationMsg_RequestStarted(0, |
+ automation_server_->Send(new AutomationMsg_RequestStarted( |
tab_->handle(), request_id, response)); |
} |
void ChromeFrameAutomationClient::OnReadComplete(int request_id, |
const std::string& data) { |
- automation_server_->Send(new AutomationMsg_RequestData(0, tab_->handle(), |
- request_id, data)); |
+ automation_server_->Send(new AutomationMsg_RequestData( |
+ tab_->handle(), request_id, data)); |
} |
void ChromeFrameAutomationClient::OnResponseEnd(int request_id, |
const URLRequestStatus& status) { |
- automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), |
- request_id, status)); |
+ automation_server_->Send(new AutomationMsg_RequestEnd( |
+ tab_->handle(), request_id, status)); |
} |
void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
const GURL& url, const std::string& cookie_string, int cookie_id) { |
- automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, |
+ automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
tab_->handle(), success, url, cookie_string, cookie_id)); |
} |