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/common/automation_messages.h | |
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/common/automation_messages.h')
-rw-r--r-- | chrome/common/automation_messages.h | 317 |
1 files changed, 161 insertions, 156 deletions
diff --git a/chrome/common/automation_messages.h b/chrome/common/automation_messages.h index ac3c4628..7a9ba91 100644 --- a/chrome/common/automation_messages.h +++ b/chrome/common/automation_messages.h @@ -34,6 +34,167 @@ struct AutomationMsg_Find_Params { bool find_next; }; +struct AutomationURLResponse { + AutomationURLResponse(); + AutomationURLResponse(const std::string& mime_type, + const std::string& headers, + int64 content_length, + const base::Time& last_modified, + const std::string& redirect_url, + int redirect_status); + ~AutomationURLResponse(); + + std::string mime_type; + std::string headers; + int64 content_length; + base::Time last_modified; + std::string redirect_url; + int redirect_status; +}; + +struct ExternalTabSettings { + ExternalTabSettings(); + ExternalTabSettings(gfx::NativeWindow parent, + const gfx::Rect& dimensions, + unsigned int style, + bool is_off_the_record, + bool load_requests_via_automation, + bool handle_top_level_requests, + const GURL& initial_url, + const GURL& referrer, + bool infobars_enabled, + bool route_all_top_level_navigations); + ~ExternalTabSettings(); + + gfx::NativeWindow parent; + gfx::Rect dimensions; + unsigned int style; + bool is_off_the_record; + bool load_requests_via_automation; + bool handle_top_level_requests; + GURL initial_url; + GURL referrer; + bool infobars_enabled; + bool route_all_top_level_navigations; +}; + +struct NavigationInfo { + NavigationInfo(); + NavigationInfo(int navigation_type, + int relative_offset, + int navigation_index, + const std::wstring& title, + const GURL& url, + const GURL& referrer, + SecurityStyle security_style, + bool displayed_insecure_content, + bool ran_insecure_content); + ~NavigationInfo(); + + int navigation_type; + int relative_offset; + int navigation_index; + std::wstring title; + GURL url; + GURL referrer; + SecurityStyle security_style; + bool displayed_insecure_content; + bool ran_insecure_content; +}; + +// A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. +struct MiniContextMenuParams { + MiniContextMenuParams(); + MiniContextMenuParams(int screen_x, + int screen_y, + const GURL& link_url, + const GURL& unfiltered_link_url, + const GURL& src_url, + const GURL& page_url, + const GURL& frame_url); + ~MiniContextMenuParams(); + + // The x coordinate for displaying the menu. + int screen_x; + + // The y coordinate for displaying the menu. + int screen_y; + + // This is the URL of the link that encloses the node the context menu was + // invoked on. + GURL link_url; + + // The link URL to be used ONLY for "copy link address". We don't validate + // this field in the frontend process. + GURL unfiltered_link_url; + + // This is the source URL for the element that the context menu was + // invoked on. Example of elements with source URLs are img, audio, and + // video. + GURL src_url; + + // This is the URL of the top level page that the context menu was invoked + // on. + GURL page_url; + + // This is the URL of the subframe that the context menu was invoked on. + GURL frame_url; +}; + +struct AttachExternalTabParams { + AttachExternalTabParams(); + AttachExternalTabParams(uint64 cookie, + const GURL& url, + const gfx::Rect& dimensions, + int disposition, + bool user_gesture, + const std::string& profile_name); + ~AttachExternalTabParams(); + + uint64 cookie; + GURL url; + gfx::Rect dimensions; + int disposition; + bool user_gesture; + std::string profile_name; +}; + +#if defined(OS_WIN) + +struct Reposition_Params { + HWND window; + HWND window_insert_after; + int left; + int top; + int width; + int height; + int flags; + bool set_parent; + HWND parent_window; +}; + +#endif // defined(OS_WIN) + +struct AutomationURLRequest { + AutomationURLRequest(); + AutomationURLRequest(const std::string& url, + const std::string& method, + const std::string& referrer, + const std::string& extra_request_headers, + scoped_refptr<net::UploadData> upload_data, + int resource_type, + int load_flags); + ~AutomationURLRequest(); + + std::string url; + std::string method; + std::string referrer; + std::string extra_request_headers; + scoped_refptr<net::UploadData> upload_data; + int resource_type; // see webkit/glue/resource_type.h + int load_flags; // see net/base/load_flags.h +}; + namespace IPC { template <> @@ -85,17 +246,6 @@ struct ParamTraits<PageType> { }; #if defined(OS_WIN) -struct Reposition_Params { - HWND window; - HWND window_insert_after; - int left; - int top; - int width; - int height; - int flags; - bool set_parent; - HWND parent_window; -}; // Traits for SetWindowPos_Params structure to pack/unpack. template <> @@ -147,26 +297,6 @@ struct ParamTraits<Reposition_Params> { }; #endif // defined(OS_WIN) -struct AutomationURLRequest { - AutomationURLRequest(); - AutomationURLRequest(const std::string& url, - const std::string& method, - const std::string& referrer, - const std::string& extra_request_headers, - scoped_refptr<net::UploadData> upload_data, - int resource_type, - int load_flags); - ~AutomationURLRequest(); - - std::string url; - std::string method; - std::string referrer; - std::string extra_request_headers; - scoped_refptr<net::UploadData> upload_data; - int resource_type; // see webkit/glue/resource_type.h - int load_flags; // see net/base/load_flags.h -}; - // Traits for AutomationURLRequest structure to pack/unpack. template <> struct ParamTraits<AutomationURLRequest> { @@ -176,24 +306,6 @@ struct ParamTraits<AutomationURLRequest> { static void Log(const param_type& p, std::string* l); }; -struct AutomationURLResponse { - AutomationURLResponse(); - AutomationURLResponse(const std::string& mime_type, - const std::string& headers, - int64 content_length, - const base::Time& last_modified, - const std::string& redirect_url, - int redirect_status); - ~AutomationURLResponse(); - - std::string mime_type; - std::string headers; - int64 content_length; - base::Time last_modified; - std::string redirect_url; - int redirect_status; -}; - // Traits for AutomationURLResponse structure to pack/unpack. template <> struct ParamTraits<AutomationURLResponse> { @@ -203,32 +315,6 @@ struct ParamTraits<AutomationURLResponse> { static void Log(const param_type& p, std::string* l); }; -struct ExternalTabSettings { - ExternalTabSettings(); - ExternalTabSettings(gfx::NativeWindow parent, - const gfx::Rect& dimensions, - unsigned int style, - bool is_off_the_record, - bool load_requests_via_automation, - bool handle_top_level_requests, - const GURL& initial_url, - const GURL& referrer, - bool infobars_enabled, - bool route_all_top_level_navigations); - ~ExternalTabSettings(); - - gfx::NativeWindow parent; - gfx::Rect dimensions; - unsigned int style; - bool is_off_the_record; - bool load_requests_via_automation; - bool handle_top_level_requests; - GURL initial_url; - GURL referrer; - bool infobars_enabled; - bool route_all_top_level_navigations; -}; - // Traits for ExternalTabSettings structure to pack/unpack. template <> struct ParamTraits<ExternalTabSettings> { @@ -238,30 +324,6 @@ struct ParamTraits<ExternalTabSettings> { static void Log(const param_type& p, std::string* l); }; -struct NavigationInfo { - NavigationInfo(); - NavigationInfo(int navigation_type, - int relative_offset, - int navigation_index, - const std::wstring& title, - const GURL& url, - const GURL& referrer, - SecurityStyle security_style, - bool displayed_insecure_content, - bool ran_insecure_content); - ~NavigationInfo(); - - int navigation_type; - int relative_offset; - int navigation_index; - std::wstring title; - GURL url; - GURL referrer; - SecurityStyle security_style; - bool displayed_insecure_content; - bool ran_insecure_content; -}; - // Traits for NavigationInfo structure to pack/unpack. template <> struct ParamTraits<NavigationInfo> { @@ -271,45 +333,6 @@ struct ParamTraits<NavigationInfo> { static void Log(const param_type& p, std::string* l); }; -// A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. -struct MiniContextMenuParams { - MiniContextMenuParams(); - MiniContextMenuParams(int screen_x, - int screen_y, - const GURL& link_url, - const GURL& unfiltered_link_url, - const GURL& src_url, - const GURL& page_url, - const GURL& frame_url); - ~MiniContextMenuParams(); - - // The x coordinate for displaying the menu. - int screen_x; - - // The y coordinate for displaying the menu. - int screen_y; - - // This is the URL of the link that encloses the node the context menu was - // invoked on. - GURL link_url; - - // The link URL to be used ONLY for "copy link address". We don't validate - // this field in the frontend process. - GURL unfiltered_link_url; - - // This is the source URL for the element that the context menu was - // invoked on. Example of elements with source URLs are img, audio, and - // video. - GURL src_url; - - // This is the URL of the top level page that the context menu was invoked - // on. - GURL page_url; - - // This is the URL of the subframe that the context menu was invoked on. - GURL frame_url; -}; - // Traits for MiniContextMenuParams structure to pack/unpack. template <> struct ParamTraits<MiniContextMenuParams> { @@ -319,24 +342,6 @@ struct ParamTraits<MiniContextMenuParams> { static void Log(const param_type& p, std::string* l); }; -struct AttachExternalTabParams { - AttachExternalTabParams(); - AttachExternalTabParams(uint64 cookie, - const GURL& url, - const gfx::Rect& dimensions, - int disposition, - bool user_gesture, - const std::string& profile_name); - ~AttachExternalTabParams(); - - uint64 cookie; - GURL url; - gfx::Rect dimensions; - int disposition; - bool user_gesture; - std::string profile_name; -}; - template <> struct ParamTraits<AttachExternalTabParams> { typedef AttachExternalTabParams param_type; |