diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 18:06:36 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 18:06:36 +0000 |
commit | 0aed2f55c27f391d56f4d2e027578e5722d3b3bc (patch) | |
tree | 6261a825a2afb58f1b82f477d3ecd7e966a322af /content | |
parent | 43bf4fa977612da47f84b4f56ac7cf38256f52f5 (diff) | |
download | chromium_src-0aed2f55c27f391d56f4d2e027578e5722d3b3bc.zip chromium_src-0aed2f55c27f391d56f4d2e027578e5722d3b3bc.tar.gz chromium_src-0aed2f55c27f391d56f4d2e027578e5722d3b3bc.tar.bz2 |
Move a bunch of renderer->browser messages to content.
TBR=tsepez
Review URL: http://codereview.chromium.org/6721021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
27 files changed, 925 insertions, 84 deletions
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 283d5bd..98c8623 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -692,7 +692,7 @@ void RenderMessageFilter::OnGotPluginInfo( const std::string& actual_mime_type, const GURL& policy_url, IPC::Message* reply_msg) { - ContentSetting setting = CONTENT_SETTING_DEFAULT; + int content_setting = CONTENT_SETTING_DEFAULT; webkit::npapi::WebPluginInfo info_copy = info; if (found) { // TODO(mpcomplete): The plugin service should do this check. We should @@ -703,14 +703,14 @@ void RenderMessageFilter::OnGotPluginInfo( std::string resource = webkit::npapi::PluginList::Singleton()->GetPluginGroupIdentifier( info_copy); - setting = content_settings_->GetContentSetting( + content_setting = content_settings_->GetContentSetting( policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, resource); } ViewHostMsg_GetPluginInfo::WriteReplyParams( - reply_msg, found, info_copy, setting, actual_mime_type); + reply_msg, found, info_copy, content_setting, actual_mime_type); Send(reply_msg); } diff --git a/content/browser/renderer_host/render_message_filter_gtk.cc b/content/browser/renderer_host/render_message_filter_gtk.cc index 9deac18..8d91b57 100644 --- a/content/browser/renderer_host/render_message_filter_gtk.cc +++ b/content/browser/renderer_host/render_message_filter_gtk.cc @@ -6,6 +6,7 @@ #include "chrome/common/render_messages.h" #include "content/browser/browser_thread.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h" #include "ui/base/clipboard/clipboard.h" diff --git a/content/browser/renderer_host/render_message_filter_win.cc b/content/browser/renderer_host/render_message_filter_win.cc index 4f305fde..f9c1bb5 100644 --- a/content/browser/renderer_host/render_message_filter_win.cc +++ b/content/browser/renderer_host/render_message_filter_win.cc @@ -4,7 +4,7 @@ #include "content/browser/renderer_host/render_message_filter.h" -#include "chrome/common/render_messages.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFactory.h" diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h index 8777a3b..ba08905 100644 --- a/content/browser/renderer_host/render_view_host.h +++ b/content/browser/renderer_host/render_view_host.h @@ -16,9 +16,9 @@ #include "chrome/common/render_view_commands.h" #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" -#include "chrome/common/window_container_type.h" #include "content/browser/renderer_host/render_widget_host.h" #include "content/common/page_zoom.h" +#include "content/common/window_container_type.h" #include "net/base/load_states.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc index 6c4a771..5ad7927 100644 --- a/content/browser/renderer_host/render_view_host_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_browsertest.cc @@ -9,12 +9,12 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/tab_specific_content_settings.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/render_messages_params.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_observer.h" +#include "content/common/view_messages.h" #include "net/base/host_port_pair.h" #include "net/test/test_server.h" diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index b50318b..b672618 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -16,8 +16,8 @@ #include "chrome/common/content_settings_types.h" #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" -#include "chrome/common/window_container_type.h" #include "content/common/dom_storage_common.h" +#include "content/common/window_container_type.h" #include "ipc/ipc_channel.h" #include "net/base/load_states.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h index 0dd25d7..1b3eae5 100644 --- a/content/browser/renderer_host/render_widget_helper.h +++ b/content/browser/renderer_host/render_widget_helper.h @@ -15,7 +15,7 @@ #include "base/ref_counted.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "chrome/common/window_container_type.h" +#include "content/common/window_container_type.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" namespace IPC { diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index d9e43f7..816f867 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -3,8 +3,6 @@ // found in the LICENSE file. #include "chrome/browser/browser_url_handler.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/test/testing_profile.h" #include "content/browser/renderer_host/test_backing_store.h" #include "content/browser/renderer_host/test_render_view_host.h" @@ -13,6 +11,7 @@ #include "content/browser/tab_contents/test_tab_contents.h" #include "content/common/content_client.h" #include "content/common/dom_storage_common.h" +#include "content/common/view_messages.h" #include "ui/gfx/rect.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 1b5aa79..aca0108 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -18,7 +18,6 @@ #include "chrome/browser/renderer_preferences_util.h" #include "chrome/common/bindings_policy.h" #include "chrome/common/net/url_request_context_getter.h" -#include "chrome/common/render_messages_params.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" @@ -33,6 +32,7 @@ #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/page_transition_types.h" +#include "content/common/view_messages.h" #include "net/base/escape.h" using WebKit::WebDragOperation; diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index a784446..5d76b05 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -16,7 +16,6 @@ #include "chrome/browser/sessions/session_types.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "content/browser/in_process_webkit/session_storage_namespace.h" #include "content/browser/site_instance.h" @@ -26,6 +25,7 @@ #include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/common/navigation_types.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" #include "grit/app_resources.h" #include "net/base/escape.h" #include "net/base/mime_util.h" diff --git a/content/browser/tab_contents/tab_contents_view.cc b/content/browser/tab_contents/tab_contents_view.cc index 771669b..a4e5c7b 100644 --- a/content/browser/tab_contents/tab_contents_view.cc +++ b/content/browser/tab_contents/tab_contents_view.cc @@ -4,7 +4,6 @@ #include "content/browser/tab_contents/tab_contents_view.h" -#include "chrome/common/render_messages_params.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host_delegate.h" @@ -13,6 +12,7 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" TabContentsView::TabContentsView(TabContents* tab_contents) : tab_contents_(tab_contents) { diff --git a/content/common/common_param_traits.cc b/content/common/common_param_traits.cc index df7bfde..8694bb2 100644 --- a/content/common/common_param_traits.cc +++ b/content/common/common_param_traits.cc @@ -11,6 +11,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/rect.h" +#include "webkit/glue/password_form.h" #include "webkit/glue/resource_loader_bridge.h" namespace { @@ -836,4 +837,43 @@ void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { l->append("<SkBitmap>"); } +void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.signon_realm); + WriteParam(m, p.origin); + WriteParam(m, p.action); + WriteParam(m, p.submit_element); + WriteParam(m, p.username_element); + WriteParam(m, p.username_value); + WriteParam(m, p.password_element); + WriteParam(m, p.password_value); + WriteParam(m, p.old_password_element); + WriteParam(m, p.old_password_value); + WriteParam(m, p.ssl_valid); + WriteParam(m, p.preferred); + WriteParam(m, p.blacklisted_by_user); +} + +bool ParamTraits<webkit_glue::PasswordForm>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->signon_realm) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->action) && + ReadParam(m, iter, &p->submit_element) && + ReadParam(m, iter, &p->username_element) && + ReadParam(m, iter, &p->username_value) && + ReadParam(m, iter, &p->password_element) && + ReadParam(m, iter, &p->password_value) && + ReadParam(m, iter, &p->old_password_element) && + ReadParam(m, iter, &p->old_password_value) && + ReadParam(m, iter, &p->ssl_valid) && + ReadParam(m, iter, &p->preferred) && + ReadParam(m, iter, &p->blacklisted_by_user); +} +void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, + std::string* l) { + l->append("<PasswordForm>"); +} + } // namespace IPC diff --git a/content/common/common_param_traits.h b/content/common/common_param_traits.h index a2c126a..8a09924 100644 --- a/content/common/common_param_traits.h +++ b/content/common/common_param_traits.h @@ -29,6 +29,7 @@ #include "webkit/glue/npruntime_util.h" #include "webkit/glue/resource_type.h" #include "webkit/glue/webcursor.h" +#include "webkit/glue/window_open_disposition.h" class SkBitmap; @@ -45,6 +46,7 @@ class UploadData; } namespace webkit_glue { +struct PasswordForm; struct ResourceDevToolsInfo; struct ResourceLoadTimingInfo; } @@ -398,6 +400,18 @@ struct ParamTraits<SkBitmap> { static void Log(const param_type& p, std::string* l); }; +template <> +struct SimilarTypeTraits<WindowOpenDisposition> { + typedef int Type; +}; + +template <> +struct ParamTraits<webkit_glue::PasswordForm> { + typedef webkit_glue::PasswordForm param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; } // namespace IPC diff --git a/content/common/view_messages.h b/content/common/view_messages.h index ea9fcbc..a6be921 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -5,27 +5,78 @@ // IPC messages for page rendering. // Multiply-included message file, hence no include guard. +#include "base/process.h" #include "content/common/common_param_traits.h" #include "content/common/css_colors.h" #include "content/common/edit_command.h" +#include "content/common/navigation_gesture.h" #include "content/common/page_transition_types.h" #include "content/common/page_zoom.h" #include "content/common/renderer_preferences.h" +#include "content/common/window_container_type.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" +#include "net/base/host_port_pair.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "ui/gfx/rect.h" #include "webkit/glue/context_menu.h" +#include "webkit/glue/password_form.h" +#include "webkit/glue/webcookie.h" #include "webkit/glue/webmenuitem.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugininfo.h" + +#if defined(OS_MACOSX) +#include "content/common/font_descriptor_mac.h" +#endif // Define enums used in this file inside an include-guard. #ifndef CONTENT_COMMON_VIEW_MESSAGES_H_ #define CONTENT_COMMON_VIEW_MESSAGES_H_ -class ViewMsg_Navigate_Type { +struct ViewHostMsg_RunFileChooser_Mode { + public: + enum Value { + // Requires that the file exists before allowing the user to pick it. + Open, + + // Like Open, but allows picking multiple files to open. + OpenMultiple, + + // Like Open, but selects a folder. + OpenFolder, + + // Allows picking a nonexistent file, and prompts to overwrite if the file + // already exists. + Save, + }; +}; + +// Values that may be OR'd together to form the 'flags' parameter of a +// ViewHostMsg_UpdateRect_Params structure. +struct ViewHostMsg_UpdateRect_Flags { + enum { + IS_RESIZE_ACK = 1 << 0, + IS_RESTORE_ACK = 1 << 1, + IS_REPAINT_ACK = 1 << 2, + }; + static bool is_resize_ack(int flags) { + return (flags & IS_RESIZE_ACK) != 0; + } + static bool is_restore_ack(int flags) { + return (flags & IS_RESTORE_ACK) != 0; + } + static bool is_repaint_ack(int flags) { + return (flags & IS_REPAINT_ACK) != 0; + } +}; + +struct ViewMsg_Navigate_Type { public: enum Value { // Reload the page. @@ -69,20 +120,60 @@ struct ViewMsg_StopFinding_Params { #define IPC_MESSAGE_START ViewMsgStart IPC_ENUM_TRAITS(CSSColors::CSSColorName) +IPC_ENUM_TRAITS(NavigationGesture) IPC_ENUM_TRAITS(PageZoom::Function) IPC_ENUM_TRAITS(RendererPreferencesHintingEnum) IPC_ENUM_TRAITS(RendererPreferencesSubpixelRenderingEnum) +IPC_ENUM_TRAITS(ViewHostMsg_RunFileChooser_Mode::Value) IPC_ENUM_TRAITS(ViewMsg_Navigate_Type::Value) IPC_ENUM_TRAITS(ViewMsg_StopFinding_Params::Action) IPC_ENUM_TRAITS(WebKit::WebContextMenuData::MediaType) IPC_ENUM_TRAITS(WebKit::WebMediaPlayerAction::Type) +IPC_ENUM_TRAITS(WebKit::WebPopupType) IPC_ENUM_TRAITS(WebMenuItem::Type) +IPC_ENUM_TRAITS(WindowContainerType) + +IPC_STRUCT_TRAITS_BEGIN(ContextMenuParams) + IPC_STRUCT_TRAITS_MEMBER(media_type) + IPC_STRUCT_TRAITS_MEMBER(x) + IPC_STRUCT_TRAITS_MEMBER(y) + IPC_STRUCT_TRAITS_MEMBER(link_url) + IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url) + IPC_STRUCT_TRAITS_MEMBER(src_url) + IPC_STRUCT_TRAITS_MEMBER(is_image_blocked) + IPC_STRUCT_TRAITS_MEMBER(page_url) + IPC_STRUCT_TRAITS_MEMBER(frame_url) + IPC_STRUCT_TRAITS_MEMBER(frame_content_state) + IPC_STRUCT_TRAITS_MEMBER(media_flags) + IPC_STRUCT_TRAITS_MEMBER(selection_text) + IPC_STRUCT_TRAITS_MEMBER(misspelled_word) + IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions) + IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled) + IPC_STRUCT_TRAITS_MEMBER(is_editable) +#if defined(OS_MACOSX) + IPC_STRUCT_TRAITS_MEMBER(writing_direction_default) + IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right) + IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left) +#endif // OS_MACOSX + IPC_STRUCT_TRAITS_MEMBER(edit_flags) + IPC_STRUCT_TRAITS_MEMBER(security_info) + IPC_STRUCT_TRAITS_MEMBER(frame_charset) + IPC_STRUCT_TRAITS_MEMBER(custom_context) + IPC_STRUCT_TRAITS_MEMBER(custom_items) +IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(EditCommand) IPC_STRUCT_TRAITS_MEMBER(name) IPC_STRUCT_TRAITS_MEMBER(value) IPC_STRUCT_TRAITS_END() +#if defined(OS_MACOSX) +IPC_STRUCT_TRAITS_BEGIN(FontDescriptor) + IPC_STRUCT_TRAITS_MEMBER(font_name) + IPC_STRUCT_TRAITS_MEMBER(font_point_size) +IPC_STRUCT_TRAITS_END() +#endif + IPC_STRUCT_TRAITS_BEGIN(RendererPreferences) IPC_STRUCT_TRAITS_MEMBER(can_accept_load_drops) IPC_STRUCT_TRAITS_MEMBER(should_antialias_text) @@ -122,6 +213,21 @@ IPC_STRUCT_TRAITS_BEGIN(WebKit::WebMediaPlayerAction) IPC_STRUCT_TRAITS_MEMBER(enable) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(WebKit::WebRect) + IPC_STRUCT_TRAITS_MEMBER(x) + IPC_STRUCT_TRAITS_MEMBER(y) + IPC_STRUCT_TRAITS_MEMBER(width) + IPC_STRUCT_TRAITS_MEMBER(height) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(WebKit::WebScreenInfo) + IPC_STRUCT_TRAITS_MEMBER(depth) + IPC_STRUCT_TRAITS_MEMBER(depthPerComponent) + IPC_STRUCT_TRAITS_MEMBER(isMonochrome) + IPC_STRUCT_TRAITS_MEMBER(rect) + IPC_STRUCT_TRAITS_MEMBER(availableRect) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(WebPreferences) IPC_STRUCT_TRAITS_MEMBER(standard_font_family) IPC_STRUCT_TRAITS_MEMBER(fixed_font_family) @@ -197,69 +303,73 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::CustomContextMenuContext) IPC_STRUCT_TRAITS_MEMBER(request_id) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(ContextMenuParams) - IPC_STRUCT_TRAITS_MEMBER(media_type) - IPC_STRUCT_TRAITS_MEMBER(x) - IPC_STRUCT_TRAITS_MEMBER(y) - IPC_STRUCT_TRAITS_MEMBER(link_url) - IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url) - IPC_STRUCT_TRAITS_MEMBER(src_url) - IPC_STRUCT_TRAITS_MEMBER(is_image_blocked) - IPC_STRUCT_TRAITS_MEMBER(page_url) - IPC_STRUCT_TRAITS_MEMBER(frame_url) - IPC_STRUCT_TRAITS_MEMBER(frame_content_state) - IPC_STRUCT_TRAITS_MEMBER(media_flags) - IPC_STRUCT_TRAITS_MEMBER(selection_text) - IPC_STRUCT_TRAITS_MEMBER(misspelled_word) - IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions) - IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled) - IPC_STRUCT_TRAITS_MEMBER(is_editable) -#if defined(OS_MACOSX) - IPC_STRUCT_TRAITS_MEMBER(writing_direction_default) - IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right) - IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left) -#endif // OS_MACOSX - IPC_STRUCT_TRAITS_MEMBER(edit_flags) - IPC_STRUCT_TRAITS_MEMBER(security_info) - IPC_STRUCT_TRAITS_MEMBER(frame_charset) - IPC_STRUCT_TRAITS_MEMBER(custom_context) - IPC_STRUCT_TRAITS_MEMBER(custom_items) +IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebCookie) + IPC_STRUCT_TRAITS_MEMBER(name) + IPC_STRUCT_TRAITS_MEMBER(value) + IPC_STRUCT_TRAITS_MEMBER(domain) + IPC_STRUCT_TRAITS_MEMBER(path) + IPC_STRUCT_TRAITS_MEMBER(expires) + IPC_STRUCT_TRAITS_MEMBER(http_only) + IPC_STRUCT_TRAITS_MEMBER(secure) + IPC_STRUCT_TRAITS_MEMBER(session) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_BEGIN(ViewMsg_ClosePage_Params) - // The identifier of the RenderProcessHost for the currently closing view. - // - // These first two parameters are technically redundant since they are - // needed only when processing the ACK message, and the processor - // theoretically knows both the process and route ID. However, this is - // difficult to figure out with our current implementation, so this - // information is duplicate here. - IPC_STRUCT_MEMBER(int, closing_process_id) +IPC_STRUCT_TRAITS_BEGIN(webkit::npapi::WebPluginGeometry) + IPC_STRUCT_TRAITS_MEMBER(window) + IPC_STRUCT_TRAITS_MEMBER(window_rect) + IPC_STRUCT_TRAITS_MEMBER(clip_rect) + IPC_STRUCT_TRAITS_MEMBER(cutout_rects) + IPC_STRUCT_TRAITS_MEMBER(rects_valid) + IPC_STRUCT_TRAITS_MEMBER(visible) +IPC_STRUCT_TRAITS_END() - // The route identifier for the currently closing RenderView. - IPC_STRUCT_MEMBER(int, closing_route_id) +IPC_STRUCT_TRAITS_BEGIN(webkit::npapi::WebPluginMimeType) + IPC_STRUCT_TRAITS_MEMBER(mime_type) + IPC_STRUCT_TRAITS_MEMBER(file_extensions) + IPC_STRUCT_TRAITS_MEMBER(description) +IPC_STRUCT_TRAITS_END() - // True when this close is for the first (closing) tab of a cross-site - // transition where we switch processes. False indicates the close is for the - // entire tab. - // - // When true, the new_* variables below must be filled in. Otherwise they must - // both be -1. - IPC_STRUCT_MEMBER(bool, for_cross_site_transition) +IPC_STRUCT_TRAITS_BEGIN(webkit::npapi::WebPluginInfo) + IPC_STRUCT_TRAITS_MEMBER(name) + IPC_STRUCT_TRAITS_MEMBER(path) + IPC_STRUCT_TRAITS_MEMBER(version) + IPC_STRUCT_TRAITS_MEMBER(desc) + IPC_STRUCT_TRAITS_MEMBER(mime_types) + IPC_STRUCT_TRAITS_MEMBER(enabled) +IPC_STRUCT_TRAITS_END() - // The identifier of the RenderProcessHost for the new view attempting to - // replace the closing one above. This must be valid when - // for_cross_site_transition is set, and must be -1 otherwise. - IPC_STRUCT_MEMBER(int, new_render_process_host_id) +IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params) + // Routing ID of the view initiating the open. + IPC_STRUCT_MEMBER(int, opener_id) - // The identifier of the *request* the new view made that is causing the - // cross-site transition. This is *not* a route_id, but the request that we - // will resume once the ACK from the closing view has been received. This - // must be valid when for_cross_site_transition is set, and must be -1 - // otherwise. - IPC_STRUCT_MEMBER(int, new_request_id) + // True if this open request came in the context of a user gesture. + IPC_STRUCT_MEMBER(bool, user_gesture) + + // Type of window requested. + IPC_STRUCT_MEMBER(WindowContainerType, window_container_type) + + // The session storage namespace ID this view should use. + IPC_STRUCT_MEMBER(int64, session_storage_namespace_id) + + // The name of the resulting frame that should be created (empty if none + // has been specified). + IPC_STRUCT_MEMBER(string16, frame_name) + + // The frame identifier of the frame initiating the open. + IPC_STRUCT_MEMBER(int64, opener_frame_id) + + // The URL of the frame initiating the open. + IPC_STRUCT_MEMBER(GURL, opener_url) + + // The security origin of the frame initiating the open. + IPC_STRUCT_MEMBER(std::string, opener_security_origin) + + // The URL that will be loaded in the new window (empty if none has been + // sepcified). + IPC_STRUCT_MEMBER(GURL, target_url) IPC_STRUCT_END() + IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params) // URL for the worker script. IPC_STRUCT_MEMBER(GURL, url) @@ -288,6 +398,78 @@ IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params) IPC_STRUCT_MEMBER(int64, script_resource_appcache_id) IPC_STRUCT_END() +// Parameters structure for ViewHostMsg_FrameNavigate, which has too many data +// parameters to be reasonably put in a predefined IPC message. +IPC_STRUCT_BEGIN(ViewHostMsg_FrameNavigate_Params) + // Page ID of this navigation. The renderer creates a new unique page ID + // anytime a new session history entry is created. This means you'll get new + // page IDs for user actions, and the old page IDs will be reloaded when + // iframes are loaded automatically. + IPC_STRUCT_MEMBER(int32, page_id) + + // The frame ID for this navigation. The frame ID uniquely identifies the + // frame the navigation happened in for a given renderer. + IPC_STRUCT_MEMBER(int64, frame_id) + + // URL of the page being loaded. + IPC_STRUCT_MEMBER(GURL, url) + + // URL of the referrer of this load. WebKit generates this based on the + // source of the event that caused the load. + IPC_STRUCT_MEMBER(GURL, referrer) + + // The type of transition. + IPC_STRUCT_MEMBER(PageTransition::Type, transition) + + // Lists the redirects that occurred on the way to the current page. This + // vector has the same format as reported by the WebDataSource in the glue, + // with the current page being the last one in the list (so even when + // there's no redirect, there will be one entry in the list. + IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) + + // Set to false if we want to update the session history but not update + // the browser history. E.g., on unreachable urls. + IPC_STRUCT_MEMBER(bool, should_update_history) + + // See SearchableFormData for a description of these. + IPC_STRUCT_MEMBER(GURL, searchable_form_url) + IPC_STRUCT_MEMBER(std::string, searchable_form_encoding) + + // See password_form.h. + IPC_STRUCT_MEMBER(webkit_glue::PasswordForm, password_form) + + // Information regarding the security of the connection (empty if the + // connection was not secure). + IPC_STRUCT_MEMBER(std::string, security_info) + + // The gesture that initiated this navigation. + IPC_STRUCT_MEMBER(NavigationGesture, gesture) + + // Contents MIME type of main frame. + IPC_STRUCT_MEMBER(std::string, contents_mime_type) + + // True if this was a post request. + IPC_STRUCT_MEMBER(bool, is_post) + + // Whether the frame navigation resulted in no change to the documents within + // the page. For example, the navigation may have just resulted in scrolling + // to a named anchor. + IPC_STRUCT_MEMBER(bool, was_within_same_page) + + // The status code of the HTTP request. + IPC_STRUCT_MEMBER(int, http_status_code) + + // Remote address of the socket which fetched this resource. + IPC_STRUCT_MEMBER(net::HostPortPair, socket_address) + + // True if the connection was proxied. In this case, socket_address + // will represent the address of the proxy, rather than the remote host. + IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy) + + // Serialized history item state to store in the navigation entry. + IPC_STRUCT_MEMBER(std::string, content_state) +IPC_STRUCT_END() + IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params) // The page_id for this navigation, or -1 if it is a new navigation. Back, // Forward, and Reload navigations should have a valid page_id. If the load @@ -329,6 +511,21 @@ IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params) IPC_STRUCT_MEMBER(std::string, extra_headers) IPC_STRUCT_END() +IPC_STRUCT_BEGIN(ViewHostMsg_RunFileChooser_Params) + IPC_STRUCT_MEMBER(ViewHostMsg_RunFileChooser_Mode::Value, mode) + + // Title to be used for the dialog. This may be empty for the default title, + // which will be either "Open" or "Save" depending on the mode. + IPC_STRUCT_MEMBER(string16, title) + + // Default file name to select in the dialog. + IPC_STRUCT_MEMBER(FilePath, default_file_name) + + // A comma-separated MIME types such as "audio/*,text/plain", that is used + // to restrict selectable files to such types. + IPC_STRUCT_MEMBER(string16, accept_types) +IPC_STRUCT_END() + // This message is used for supporting popup menus on Mac OS X using native // Cocoa controls. The renderer sends us this message which we use to populate // the popup menu. @@ -352,6 +549,96 @@ IPC_STRUCT_BEGIN(ViewHostMsg_ShowPopup_Params) IPC_STRUCT_MEMBER(bool, right_aligned) IPC_STRUCT_END() +IPC_STRUCT_BEGIN(ViewHostMsg_UpdateRect_Params) + // The bitmap to be painted into the view at the locations specified by + // update_rects. + IPC_STRUCT_MEMBER(TransportDIB::Id, bitmap) + + // The position and size of the bitmap. + IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect) + + // The scroll offset. Only one of these can be non-zero, and if they are + // both zero, then it means there is no scrolling and the scroll_rect is + // ignored. + IPC_STRUCT_MEMBER(int, dx) + IPC_STRUCT_MEMBER(int, dy) + + // The rectangular region to scroll. + IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect) + + // The scroll offset of the render view. + IPC_STRUCT_MEMBER(gfx::Point, scroll_offset) + + // The regions of the bitmap (in view coords) that contain updated pixels. + // In the case of scrolling, this includes the scroll damage rect. + IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects) + + // The size of the RenderView when this message was generated. This is + // included so the host knows how large the view is from the perspective of + // the renderer process. This is necessary in case a resize operation is in + // progress. + IPC_STRUCT_MEMBER(gfx::Size, view_size) + + // The area of the RenderView reserved for resize corner when this message + // was generated. Reported for the same reason as view_size is. + IPC_STRUCT_MEMBER(gfx::Rect, resizer_rect) + + // New window locations for plugin child windows. + IPC_STRUCT_MEMBER(std::vector<webkit::npapi::WebPluginGeometry>, + plugin_window_moves) + + // The following describes the various bits that may be set in flags: + // + // ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK + // Indicates that this is a response to a ViewMsg_Resize message. + // + // ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK + // Indicates that this is a response to a ViewMsg_WasRestored message. + // + // ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK + // Indicates that this is a response to a ViewMsg_Repaint message. + // + // If flags is zero, then this message corresponds to an unsoliticed paint + // request by the render view. Any of the above bits may be set in flags, + // which would indicate that this paint message is an ACK for multiple + // request messages. + IPC_STRUCT_MEMBER(int, flags) +IPC_STRUCT_END() + +IPC_STRUCT_BEGIN(ViewMsg_ClosePage_Params) + // The identifier of the RenderProcessHost for the currently closing view. + // + // These first two parameters are technically redundant since they are + // needed only when processing the ACK message, and the processor + // theoretically knows both the process and route ID. However, this is + // difficult to figure out with our current implementation, so this + // information is duplicate here. + IPC_STRUCT_MEMBER(int, closing_process_id) + + // The route identifier for the currently closing RenderView. + IPC_STRUCT_MEMBER(int, closing_route_id) + + // True when this close is for the first (closing) tab of a cross-site + // transition where we switch processes. False indicates the close is for the + // entire tab. + // + // When true, the new_* variables below must be filled in. Otherwise they must + // both be -1. + IPC_STRUCT_MEMBER(bool, for_cross_site_transition) + + // The identifier of the RenderProcessHost for the new view attempting to + // replace the closing one above. This must be valid when + // for_cross_site_transition is set, and must be -1 otherwise. + IPC_STRUCT_MEMBER(int, new_render_process_host_id) + + // The identifier of the *request* the new view made that is causing the + // cross-site transition. This is *not* a route_id, but the request that we + // will resume once the ACK from the closing view has been received. This + // must be valid when for_cross_site_transition is set, and must be -1 + // otherwise. + IPC_STRUCT_MEMBER(int, new_request_id) +IPC_STRUCT_END() + IPC_STRUCT_BEGIN(ViewMsg_New_Params) // The parent window's id. IPC_STRUCT_MEMBER(gfx::NativeViewId, parent_window) @@ -786,6 +1073,82 @@ IPC_MESSAGE_ROUTED1(ViewMsg_NetworkStateChanged, // Messages sent from the renderer to the browser. +// Sent by the renderer when it is creating a new window. The browser creates +// a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is +// MSG_ROUTING_NONE, the view couldn't be created. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateWindow, + ViewHostMsg_CreateWindow_Params, + int /* route_id */, + int64 /* cloned_session_storage_namespace_id */) + +// Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like +// <select> dropdowns. This message is sent to the TabContents that +// contains the widget being created. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateWidget, + int /* opener_id */, + WebKit::WebPopupType /* popup type */, + int /* route_id */) + +// Similar to ViewHostMsg_CreateWidget except the widget is a full screen +// window. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateFullscreenWidget, + int /* opener_id */, + int /* route_id */) + +// These three messages are sent to the parent RenderViewHost to display the +// page/widget that was created by +// CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id +// refers to the id that was returned from the Create message above. +// The initial_position parameter is a rectangle in screen coordinates. +// +// FUTURE: there will probably be flags here to control if the result is +// in a new window. +IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView, + int /* route_id */, + WindowOpenDisposition /* disposition */, + gfx::Rect /* initial_pos */, + bool /* opened_by_user_gesture */) + +IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget, + int /* route_id */, + gfx::Rect /* initial_pos */) + +// Message to show a full screen widget. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget, + int /* route_id */) + +// This message is sent after ViewHostMsg_ShowView to cause the RenderView +// to run in a modal fashion until it is closed. +IPC_SYNC_MESSAGE_ROUTED0_0(ViewHostMsg_RunModal) + +// Indicates the renderer is ready in response to a ViewMsg_New or +// a ViewMsg_CreatingNew_ACK. +IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady) + +// Indicates the renderer process is gone. This actually is sent by the +// browser process to itself, but keeps the interface cleaner. +IPC_MESSAGE_ROUTED2(ViewHostMsg_RenderViewGone, + int, /* this really is base::TerminationStatus */ + int /* exit_code */) + +// Sent by the renderer process to request that the browser close the view. +// This corresponds to the window.close() API, and the browser may ignore +// this message. Otherwise, the browser will generates a ViewMsg_Close +// message to close the view. +IPC_MESSAGE_ROUTED0(ViewHostMsg_Close) + +// Sent by the renderer process to request that the browser move the view. +// This corresponds to the window.resizeTo() and window.moveTo() APIs, and +// the browser may ignore this message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove, + gfx::Rect /* position */) + +// Notifies the browser that a frame in the view has changed. This message +// has a lot of parameters and is packed/unpacked by functions defined in +// render_messages.h. +IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameNavigate, + ViewHostMsg_FrameNavigate_Params) + // Used to tell the parent that the user right clicked on an area of the // content area, and a context menu should be shown for it. The params // object contains information about the node(s) that were selected when the @@ -829,6 +1192,223 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK, IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK, ViewMsg_ClosePage_Params) +// Notifies the browser that we have session history information. +// page_id: unique ID that allows us to distinguish between history entries. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState, + int32 /* page_id */, + std::string /* state */) + +// Notifies the browser that a document has been loaded in a frame. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentLoadedInFrame, + int64 /* frame_id */) + +// Notifies the browser that a frame finished loading. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFinishLoad, + int64 /* frame_id */) + +// Changes the title for the page in the UI when the page is navigated or the +// title changes. +// TODO(darin): use a UTF-8 string to reduce data size +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTitle, + int32, + std::wstring) + +// Changes the icon url for the page in the UI. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateIconURL, + int32, + GURL) + +// Change the encoding name of the page in UI when the page has detected +// proper encoding name. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateEncoding, + std::string /* new encoding name */) + +// Notifies the browser that we want to show a destination url for a potential +// action (e.g. when the user is hovering over a link). +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTargetURL, + int32, + GURL) + +// Sent when the renderer starts loading the page. This corresponds to +// WebKit's notion of the throbber starting. Note that sometimes you may get +// duplicates of these during a single load. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStartLoading) + +// Sent when the renderer is done loading a page. This corresponds to WebKit's +// notion of the throbber stopping. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopLoading) + +// Sent when the renderer main frame has made progress loading. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeLoadProgress, + double /* load_progress */) + +// Sent when the document element is available for the toplevel frame. This +// happens after the page starts loading, but before all resources are +// finished. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DocumentAvailableInMainFrame) + +// Sent when after the onload handler has been invoked for the document +// in the toplevel frame. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, + int32 /* page_id */) + +// Sent when the renderer loads a resource from its memory cache. +// The security info is non empty if the resource was originally loaded over +// a secure connection. +// Note: May only be sent once per URL per frame per committed load. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DidLoadResourceFromMemoryCache, + GURL /* url */, + std::string /* security info */) + +// Sent when the renderer displays insecure content in a secure page. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent) + +// Sent when the renderer runs insecure content in a secure origin. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent, + std::string /* security_origin */, + GURL /* target URL */) + +// Sent when the renderer starts a provisional load for a frame. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DidStartProvisionalLoadForFrame, + int64 /* frame_id */, + bool /* true if it is the main frame */, + GURL /* url */) + +// Sent when the renderer fails a provisional load with an error. +IPC_MESSAGE_ROUTED5(ViewHostMsg_DidFailProvisionalLoadWithError, + int64 /* frame_id */, + bool /* true if it is the main frame */, + int /* error_code */, + GURL /* url */, + bool /* true if the failure is the result of + navigating to a POST again and we're going to + show the POST interstitial */) + +// Tells the render view that a ViewHostMsg_PaintAtSize message was +// processed, and the DIB is ready for use. |tag| has the same value that +// the tag sent along with ViewMsg_PaintAtSize. +IPC_MESSAGE_ROUTED2(ViewHostMsg_PaintAtSize_ACK, + int /* tag */, + gfx::Size /* size */) + +// Sent to update part of the view. In response to this message, the host +// generates a ViewMsg_UpdateRect_ACK message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect, + ViewHostMsg_UpdateRect_Params) + +// Sent by the renderer when accelerated compositing is enabled or disabled to +// notify the browser whether or not is should do painting. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing, + bool /* true if the accelerated compositor is actve */) + +// Acknowledges receipt of a ViewMsg_HandleInputEvent message. +// Payload is a WebInputEvent::Type which is the type of the event, followed +// by an optional WebInputEvent which is provided only if the event was not +// processed. +IPC_MESSAGE_ROUTED0(ViewHostMsg_HandleInputEvent_ACK) + +IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus) +IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur) + +// Message sent from renderer to the browser when focus changes inside the +// webpage. The parameter says whether the newly focused element needs +// keyboard input (true for textfields, text areas and content editable divs). +IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged, + bool /* is_editable_node */) + +// Returns the window location of the given window. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetWindowRect, + gfx::NativeViewId /* window */, + gfx::Rect /* Out: Window location */) + +IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor, + WebCursor) + +// Used to set a cookie. The cookie is set asynchronously, but will be +// available to a subsequent ViewHostMsg_GetCookies request. +IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookie */) + +// Used to get cookies for the given URL. This may block waiting for a +// previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookies */) + +// Used to get raw cookie information for the given URL. This may block +// waiting for a previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetRawCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::vector<webkit_glue::WebCookie> + /* raw_cookies */) + +// Used to delete cookie for the given URL and name +IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie, + GURL /* url */, + std::string /* cookie_name */) + +// Used to check if cookies are enabled for the given URL. This may block +// waiting for a previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_CookiesEnabled, + GURL /* url */, + GURL /* first_party_for_cookies */, + bool /* cookies_enabled */) + +// Used to get the list of plugins +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins, + bool /* refresh*/, + std::vector<webkit::npapi::WebPluginInfo> /* plugins */) + +// Return information about a plugin for the given URL and MIME +// type. If there is no matching plugin, |found| is false. If +// |enabled| in the WebPluginInfo struct is false, the plug-in is +// treated as if it was not installed at all. +// +// TODO(jam): until we get ContentSetting out of content completely, sending it +// as int temporarily so we can move these messages to content. +// +// If |setting| is set to CONTENT_SETTING_BLOCK, the plug-in is +// blocked by the content settings for |policy_url|. It still +// appears in navigator.plugins in Javascript though, and can be +// loaded via click-to-play. +// +// If |setting| is set to CONTENT_SETTING_ALLOW, the domain is +// explicitly white-listed for the plug-in, or the user has chosen +// not to block nonsandboxed plugins. +// +// If |setting| is set to CONTENT_SETTING_DEFAULT, the plug-in is +// neither blocked nor white-listed, which means that it's allowed +// by default and can still be blocked if it's non-sandboxed. +// +// |actual_mime_type| is the actual mime type supported by the +// plugin found that match the URL given (one for each item in +// |info|). +IPC_SYNC_MESSAGE_CONTROL4_4(ViewHostMsg_GetPluginInfo, + int /* routing_id */, + GURL /* url */, + GURL /* policy_url */, + std::string /* mime_type */, + bool /* found */, + webkit::npapi::WebPluginInfo /* plugin info */, + int /* setting */, + std::string /* actual_mime_type */) + +// A renderer sends this to the browser process when it wants to +// create a plugin. The browser will create the plugin process if +// necessary, and will return a handle to the channel on success. +// On error an empty string is returned. +IPC_SYNC_MESSAGE_CONTROL3_2(ViewHostMsg_OpenChannelToPlugin, + int /* routing_id */, + GURL /* url */, + std::string /* mime_type */, + IPC::ChannelHandle /* channel_handle */, + webkit::npapi::WebPluginInfo /* info */) // A renderer sends this to the browser process when it wants to create a // worker. The browser will create the worker process if necessary, and @@ -870,3 +1450,132 @@ IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker, // worker. IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker, int /* route_id */) + +// Tells the browser that a specific Appcache manifest in the current page +// was accessed. +IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed, + GURL /* manifest url */, + bool /* blocked by policy */) + +// Tells the browser that a specific Web database in the current page was +// accessed. +IPC_MESSAGE_ROUTED5(ViewHostMsg_WebDatabaseAccessed, + GURL /* origin url */, + string16 /* database name */, + string16 /* database display name */, + unsigned long /* estimated size */, + bool /* blocked by policy */) + +// Initiates a download based on user actions like 'ALT+click'. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DownloadUrl, + GURL /* url */, + GURL /* referrer */) + +// Used to go to the session history entry at the given offset (ie, -1 will +// return the "back" item). +IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset, + int /* offset (from current) of history item to get */) + +IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_RunJavaScriptMessage, + std::wstring /* in - alert message */, + std::wstring /* in - default prompt */, + GURL /* in - originating page URL */, + int /* in - dialog flags */, + bool /* out - success */, + std::wstring /* out - prompt field */) + +// Provides the contents for the given page that was loaded recently. +IPC_MESSAGE_ROUTED5(ViewHostMsg_PageContents, + GURL /* URL of the page */, + int32 /* page id */, + string16 /* page contents */, + std::string /* page ISO639_1 language code */, + bool /* whether the page can be translated */) + +// Requests that the given URL be opened in the specified manner. +IPC_MESSAGE_ROUTED3(ViewHostMsg_OpenURL, + GURL /* url */, + GURL /* referrer */, + WindowOpenDisposition /* disposition */) + +// Notifies that the preferred size of the content changed. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange, + gfx::Size /* pref_size */) + +// A message from HTML-based UI. When (trusted) Javascript calls +// send(message, args), this message is sent to the browser. +IPC_MESSAGE_ROUTED3(ViewHostMsg_WebUISend, + GURL /* source_url */, + std::string /* message */, + std::string /* args (as a JSON string) */) + +// A renderer sends this to the browser process when it wants to +// create a pepper plugin. The browser will create the plugin process if +// necessary, and will return a handle to the channel on success. +// On error an empty string is returned. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_OpenChannelToPepperPlugin, + FilePath /* path */, + base::ProcessHandle /* plugin_process_handle */, + IPC::ChannelHandle /* handle to channel */) + +#if defined(USE_X11) +// A renderer sends this when it needs a browser-side widget for +// hosting a windowed plugin. id is the XID of the plugin window, for which +// the container is created. +IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer, + gfx::PluginWindowHandle /* id */) + +// Destroy a plugin container previously created using CreatePluginContainer. +// id is the XID of the plugin window corresponding to the container that is +// to be destroyed. +IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer, + gfx::PluginWindowHandle /* id */) +#endif + +#if defined(OS_MACOSX) +// Request that the browser load a font into shared memory for us. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_LoadFont, + FontDescriptor /* font to load */, + uint32 /* buffer size */, + base::SharedMemoryHandle /* font data */) +#endif + +#if defined(OS_WIN) +// Request that the given font be loaded by the browser so it's cached by the +// OS. Please see ChildProcessHost::PreCacheFont for details. +IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_PreCacheFont, + LOGFONT /* font data */) +#endif // defined(OS_WIN) + +// Returns WebScreenInfo corresponding to the view. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetScreenInfo, + gfx::NativeViewId /* view */, + WebKit::WebScreenInfo /* results */) + +// Send the tooltip text for the current mouse position to the browser. +IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText, + std::wstring /* tooltip text string */, + WebKit::WebTextDirection /* text direction hint */) + +// Notification that the text selection has changed. +IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionChanged, + std::string /* currently selected text */) + +// Asks the browser to display the file chooser. The result is returned in a +// ViewHost_RunFileChooserResponse message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser, + ViewHostMsg_RunFileChooser_Params) + +// Tells the browser to move the focus to the next (previous if reverse is +// true) focusable element. +IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus, + bool /* reverse */) + +// Returns the window location of the window this widget is embeded. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowRect, + gfx::NativeViewId /* window */, + gfx::Rect /* Out: Window location */) diff --git a/content/common/window_container_type.cc b/content/common/window_container_type.cc new file mode 100644 index 0000000..20ba687 --- /dev/null +++ b/content/common/window_container_type.cc @@ -0,0 +1,41 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/common/window_container_type.h" + +#include "base/string_util.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" + +namespace { + +const char kBackground[] = "background"; +const char kPersistent[] = "persistent"; + +} + +WindowContainerType WindowFeaturesToContainerType( + const WebKit::WebWindowFeatures& window_features) { + bool background = false; + bool persistent = false; + + for (size_t i = 0; i < window_features.additionalFeatures.size(); ++i) { + if (LowerCaseEqualsASCII(window_features.additionalFeatures[i], + kBackground)) + background = true; + else if (LowerCaseEqualsASCII(window_features.additionalFeatures[i], + kPersistent)) + persistent = true; + } + + if (background) { + if (persistent) + return WINDOW_CONTAINER_TYPE_PERSISTENT; + else + return WINDOW_CONTAINER_TYPE_BACKGROUND; + } else { + return WINDOW_CONTAINER_TYPE_NORMAL; + } +} diff --git a/content/common/window_container_type.h b/content/common/window_container_type.h new file mode 100644 index 0000000..761f9a6 --- /dev/null +++ b/content/common/window_container_type.h @@ -0,0 +1,36 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_COMMON_WINDOW_CONTAINER_TYPE_H_ +#define CONTENT_COMMON_WINDOW_CONTAINER_TYPE_H_ +#pragma once + +namespace WebKit { + +struct WebWindowFeatures; + +} + +// "Container" types which can be requested via the window.open feature +// string. +enum WindowContainerType { + // A window shown in popup or tab. + WINDOW_CONTAINER_TYPE_NORMAL = 0, + + // A window run as a hidden "background" page. + WINDOW_CONTAINER_TYPE_BACKGROUND, + + // A window run as a hidden "background" page that wishes to be started + // upon browser launch and run beyond the lifetime of the pages that + // reference it. + WINDOW_CONTAINER_TYPE_PERSISTENT, + + WINDOW_CONTAINER_TYPE_MAX_VALUE +}; + +// Conversion function: +WindowContainerType WindowFeaturesToContainerType( + const WebKit::WebWindowFeatures& window_features); + +#endif // CONTENT_COMMON_WINDOW_CONTAINER_TYPE_H_ diff --git a/content/content_common.gypi b/content/content_common.gypi index 6b20667e..6f1c8e5 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -187,6 +187,8 @@ 'common/webblob_messages.h', 'common/webmessageportchannel_impl.cc', 'common/webmessageportchannel_impl.h', + 'common/window_container_type.cc', + 'common/window_container_type.h', 'common/worker_messages.h', ], 'conditions': [ diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc index 5cdeb85..4029db7 100644 --- a/content/renderer/load_progress_tracker.cc +++ b/content/renderer/load_progress_tracker.cc @@ -5,7 +5,7 @@ #include "content/renderer/load_progress_tracker.h" #include "base/message_loop.h" -#include "chrome/common/render_messages.h" +#include "content/common/view_messages.h" #include "content/renderer/render_view.h" namespace { diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc index 730976d..e8446a6 100644 --- a/content/renderer/render_view.cc +++ b/content/renderer/render_view.cc @@ -38,7 +38,6 @@ #include "chrome/common/thumbnail_score.h" #include "chrome/common/url_constants.h" #include "chrome/common/web_apps.h" -#include "chrome/common/window_container_type.h" #include "chrome/renderer/about_handler.h" #include "chrome/renderer/autofill/autofill_agent.h" #include "chrome/renderer/autofill/form_manager.h" @@ -76,7 +75,6 @@ #include "content/common/file_system/file_system_dispatcher.h" #include "content/common/file_system/webfilesystem_callback_dispatcher.h" #include "content/common/notification_service.h" -#include "content/common/page_zoom.h" #include "content/common/pepper_messages.h" #include "content/common/renderer_preferences.h" #include "content/common/view_messages.h" @@ -915,11 +913,11 @@ WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, const WebPluginParams& params) { webkit::npapi::WebPluginInfo info; bool found; - ContentSetting setting; + int content_setting; std::string mime_type; Send(new ViewHostMsg_GetPluginInfo( routing_id_, params.url, frame->top()->url(), params.mimeType.utf8(), - &found, &info, &setting, &mime_type)); + &found, &info, &content_setting, &mime_type)); if (!found || !webkit::npapi::IsPluginEnabled(info)) return NULL; @@ -2299,11 +2297,11 @@ bool RenderView::runFileChooser( return false; ViewHostMsg_RunFileChooser_Params ipc_params; if (params.directory) - ipc_params.mode = ViewHostMsg_RunFileChooser_Params::OpenFolder; + ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::OpenFolder; else if (params.multiSelect) - ipc_params.mode = ViewHostMsg_RunFileChooser_Params::OpenMultiple; + ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::OpenMultiple; else - ipc_params.mode = ViewHostMsg_RunFileChooser_Params::Open; + ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::Open; ipc_params.title = params.title; ipc_params.default_file_name = webkit_glue::WebStringToFilePath(params.initialValue); diff --git a/content/renderer/render_widget_browsertest.cc b/content/renderer/render_widget_browsertest.cc index a1b46d2..5f32ce1 100644 --- a/content/renderer/render_widget_browsertest.cc +++ b/content/renderer/render_widget_browsertest.cc @@ -10,8 +10,7 @@ #include "base/file_util.h" #include "base/ref_counted_memory.h" #include "base/stringprintf.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" +#include "content/common/view_messages.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" diff --git a/content/renderer/render_widget_fullscreen.cc b/content/renderer/render_widget_fullscreen.cc index 1fc5c6d..e32c4d9 100644 --- a/content/renderer/render_widget_fullscreen.cc +++ b/content/renderer/render_widget_fullscreen.cc @@ -4,8 +4,8 @@ #include "content/renderer/render_widget_fullscreen.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" using WebKit::WebWidget; diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index 128129b..fba73ff 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc @@ -4,11 +4,11 @@ #include "content/renderer/render_widget_fullscreen_pepper.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "content/renderer/ggl.h" #include "content/renderer/gpu_channel_host.h" #include "content/renderer/pepper_platform_context_3d_impl.h" +#include "content/common/view_messages.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" diff --git a/content/renderer/renderer_webapplicationcachehost_impl.cc b/content/renderer/renderer_webapplicationcachehost_impl.cc index 40aff42..c22d4e3 100644 --- a/content/renderer/renderer_webapplicationcachehost_impl.cc +++ b/content/renderer/renderer_webapplicationcachehost_impl.cc @@ -5,8 +5,8 @@ #include "content/renderer/renderer_webapplicationcachehost_impl.h" #include "chrome/common/content_settings_types.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" +#include "content/common/view_messages.h" #include "content/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" diff --git a/content/renderer/renderer_webcookiejar_impl.cc b/content/renderer/renderer_webcookiejar_impl.cc index 4fb1a0a..3bbb551 100644 --- a/content/renderer/renderer_webcookiejar_impl.cc +++ b/content/renderer/renderer_webcookiejar_impl.cc @@ -5,7 +5,7 @@ #include "content/renderer/renderer_webcookiejar_impl.h" #include "base/utf_string_conversions.h" -#include "chrome/common/render_messages.h" +#include "content/common/view_messages.h" #include "chrome/renderer/render_thread.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCookie.h" #include "webkit/glue/webcookie.h" diff --git a/content/renderer/renderer_webkitclient_impl.cc b/content/renderer/renderer_webkitclient_impl.cc index 8150b32..48850d2 100644 --- a/content/renderer/renderer_webkitclient_impl.cc +++ b/content/renderer/renderer_webkitclient_impl.cc @@ -18,6 +18,7 @@ #include "content/common/file_system/webfilesystem_impl.h" #include "content/common/file_utilities_messages.h" #include "content/common/mime_registry_messages.h" +#include "content/common/view_messages.h" #include "content/common/webblobregistry_impl.h" #include "content/common/webmessageportchannel_impl.h" #include "content/plugin/npobject_util.h" diff --git a/content/renderer/web_ui_bindings.cc b/content/renderer/web_ui_bindings.cc index 4d555da..26d1753 100644 --- a/content/renderer/web_ui_bindings.cc +++ b/content/renderer/web_ui_bindings.cc @@ -8,7 +8,7 @@ #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" #include "base/values.h" -#include "chrome/common/render_messages.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc index 35b171f8..ad4c1a4 100644 --- a/content/renderer/webplugin_delegate_proxy.cc +++ b/content/renderer/webplugin_delegate_proxy.cc @@ -24,6 +24,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "content/common/plugin_messages.h" +#include "content/common/view_messages.h" #include "content/plugin/npobject_proxy.h" #include "content/plugin/npobject_stub.h" #include "content/plugin/npobject_util.h" |