diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 22:15:34 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 22:15:34 +0000 |
commit | f5494d49ab74e3d116540b14db3457558f54c88e (patch) | |
tree | beb367c01c187652d02091a5067a69d5bc0fa064 /chrome/browser/external_tab_container_win.cc | |
parent | a9f39a313b7ecc11d98727d869e15094481f3a65 (diff) | |
download | chromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.zip chromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.tar.gz chromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.tar.bz2 |
Clean up Automation and Chrome Frame IPC code.-only use routed messages when needed-use routing IDs to avoid manually unpacking messages-remove data structures from IPC namespace (that should only be used for IPC code, and param traits)Note that I temporarily commented out part of a test in external_tab_test.cc because I couldn't figure out how to get the updated gmock macros to compile.
Review URL: http://codereview.chromium.org/5998006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container_win.cc')
-rw-r--r-- | chrome/browser/external_tab_container_win.cc | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index f2f3e83..976d27d 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -344,7 +344,7 @@ void ExternalTabContainer::OpenURLFromTab(TabContents* source, case NEW_WINDOW: case SAVE_TO_DISK: if (automation_) { - automation_->Send(new AutomationMsg_OpenURL(0, tab_handle_, + automation_->Send(new AutomationMsg_OpenURL(tab_handle_, url, referrer, disposition)); // TODO(ananta) @@ -374,10 +374,10 @@ void ExternalTabContainer::OpenURLFromTab(TabContents* source, void ExternalTabContainer::NavigationStateChanged(const TabContents* source, unsigned changed_flags) { if (automation_) { - IPC::NavigationInfo nav_info; + NavigationInfo nav_info; if (InitNavigationInfo(&nav_info, NavigationType::NAV_IGNORE, 0)) automation_->Send(new AutomationMsg_NavigationStateChanged( - 0, tab_handle_, changed_flags, nav_info)); + tab_handle_, changed_flags, nav_info)); } } @@ -432,14 +432,14 @@ void ExternalTabContainer::AddNewContents(TabContents* source, uintptr_t cookie = reinterpret_cast<uintptr_t>(new_container.get()); pending_tabs_.Get()[cookie] = new_container; new_container->set_pending(true); - IPC::AttachExternalTabParams attach_params_; + AttachExternalTabParams attach_params_; attach_params_.cookie = static_cast<uint64>(cookie); attach_params_.dimensions = initial_pos; attach_params_.user_gesture = user_gesture; attach_params_.disposition = disposition; attach_params_.profile_name = WideToUTF8( tab_contents()->profile()->GetPath().DirName().BaseName().value()); - automation_->Send(new AutomationMsg_AttachExternalTab(0, + automation_->Send(new AutomationMsg_AttachExternalTab( tab_handle_, attach_params_)); } else { NOTREACHED(); @@ -479,7 +479,7 @@ void ExternalTabContainer::CloseContents(TabContents* source) { automation_->Send(unload_reply_message_); unload_reply_message_ = NULL; } else { - automation_->Send(new AutomationMsg_CloseExternalTab(0, tab_handle_)); + automation_->Send(new AutomationMsg_CloseExternalTab(tab_handle_)); } } @@ -496,7 +496,7 @@ void ExternalTabContainer::UpdateTargetURL(TabContents* source, if (automation_) { std::wstring url_string = CA2W(url.spec().c_str()); automation_->Send( - new AutomationMsg_UpdateTargetUrl(0, tab_handle_, url_string)); + new AutomationMsg_UpdateTargetUrl(tab_handle_, url_string)); } } @@ -511,9 +511,8 @@ void ExternalTabContainer::ForwardMessageToExternalHost( const std::string& message, const std::string& origin, const std::string& target) { if (automation_) { - automation_->Send( - new AutomationMsg_ForwardMessageToExternalHost(0, tab_handle_, - message, origin, target)); + automation_->Send(new AutomationMsg_ForwardMessageToExternalHost( + tab_handle_, message, origin, target)); } } @@ -527,7 +526,7 @@ gfx::NativeWindow ExternalTabContainer::GetFrameNativeWindow() { bool ExternalTabContainer::TakeFocus(bool reverse) { if (automation_) { - automation_->Send(new AutomationMsg_TabbedOut(0, tab_handle_, + automation_->Send(new AutomationMsg_TabbedOut(tab_handle_, win_util::IsShiftPressed())); } @@ -622,7 +621,7 @@ bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) { POINT screen_pt = { params.x, params.y }; MapWindowPoints(GetNativeView(), HWND_DESKTOP, &screen_pt, 1); - IPC::MiniContextMenuParams ipc_params( + MiniContextMenuParams ipc_params( screen_pt.x, screen_pt.y, params.link_url, @@ -633,7 +632,7 @@ bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) { bool rtl = base::i18n::IsRTL(); automation_->Send( - new AutomationMsg_ForwardContextMenuToExternalHost(0, tab_handle_, + new AutomationMsg_ForwardContextMenuToExternalHost(tab_handle_, external_context_menu_->GetMenuHandle(), rtl ? TPM_RIGHTALIGN : TPM_LEFTALIGN, ipc_params)); @@ -728,7 +727,7 @@ void ExternalTabContainer::Observe(NotificationType type, if (load != NULL && PageTransition::IsMainFrame(load->origin())) { TRACE_EVENT_END("ExternalTabContainer::Navigate", 0, load->url().spec()); - automation_->Send(new AutomationMsg_TabLoaded(0, tab_handle_, + automation_->Send(new AutomationMsg_TabLoaded(tab_handle_, load->url())); } break; @@ -745,18 +744,18 @@ void ExternalTabContainer::Observe(NotificationType type, if (commit->http_status_code >= kHttpClientErrorStart && commit->http_status_code <= kHttpServerErrorEnd) { automation_->Send(new AutomationMsg_NavigationFailed( - 0, tab_handle_, commit->http_status_code, commit->entry->url())); + tab_handle_, commit->http_status_code, commit->entry->url())); ignore_next_load_notification_ = true; } else { - IPC::NavigationInfo navigation_info; + NavigationInfo navigation_info; // When the previous entry index is invalid, it will be -1, which // will still make the computation come out right (navigating to the // 0th entry will be +1). if (InitNavigationInfo(&navigation_info, commit->type, commit->previous_entry_index - tab_contents_->controller().last_committed_entry_index())) - automation_->Send(new AutomationMsg_DidNavigate(0, tab_handle_, + automation_->Send(new AutomationMsg_DidNavigate(tab_handle_, navigation_info)); } break; @@ -765,7 +764,7 @@ void ExternalTabContainer::Observe(NotificationType type, const ProvisionalLoadDetails* load_details = Details<ProvisionalLoadDetails>(details).ptr(); automation_->Send(new AutomationMsg_NavigationFailed( - 0, tab_handle_, load_details->error_code(), load_details->url())); + tab_handle_, load_details->error_code(), load_details->url())); ignore_next_load_notification_ = true; break; @@ -860,11 +859,11 @@ bool ExternalTabContainer::ProcessUnhandledKeyStroke(HWND window, msg.message = message; msg.wParam = wparam; msg.lParam = lparam; - automation_->Send(new AutomationMsg_HandleAccelerator(0, tab_handle_, msg)); + automation_->Send(new AutomationMsg_HandleAccelerator(tab_handle_, msg)); return true; } -bool ExternalTabContainer::InitNavigationInfo(IPC::NavigationInfo* nav_info, +bool ExternalTabContainer::InitNavigationInfo(NavigationInfo* nav_info, NavigationType::Type nav_type, int relative_offset) { DCHECK(nav_info); @@ -990,7 +989,7 @@ void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { bool ExternalTabContainer::OnGoToEntryOffset(int offset) { if (load_requests_via_automation_) { automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( - 0, tab_handle_, offset)); + tab_handle_, offset)); return false; } |