diff options
21 files changed, 182 insertions, 360 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 34956bc..f18e926 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -95,6 +95,7 @@ #include "content/common/process_watcher.h" #include "content/common/resource_messages.h" #include "content/common/result_codes.h" +#include "content/common/view_messages.h" #include "grit/generated_resources.h" #include "ipc/ipc_logging.h" #include "ipc/ipc_platform_file.h" diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index a845f31..cc15107 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -149,7 +149,6 @@ 'common/chrome_content_plugin_client.cc', 'common/chrome_content_plugin_client.h', 'common/common_glue.cc', - 'common/css_colors.h', 'common/default_plugin.cc', 'common/default_plugin.h', 'common/deprecated/event_sys-inl.h', diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index 52d7280..e3901c2 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -288,204 +288,6 @@ void ParamTraits<webkit::npapi::WebPluginInfo>::Log(const param_type& p, l->append(")"); } -void ParamTraits<RendererPreferences>::Write(Message* m, const param_type& p) { - WriteParam(m, p.can_accept_load_drops); - WriteParam(m, p.should_antialias_text); - WriteParam(m, static_cast<int>(p.hinting)); - WriteParam(m, static_cast<int>(p.subpixel_rendering)); - WriteParam(m, p.focus_ring_color); - WriteParam(m, p.thumb_active_color); - WriteParam(m, p.thumb_inactive_color); - WriteParam(m, p.track_color); - WriteParam(m, p.active_selection_bg_color); - WriteParam(m, p.active_selection_fg_color); - WriteParam(m, p.inactive_selection_bg_color); - WriteParam(m, p.inactive_selection_fg_color); - WriteParam(m, p.browser_handles_top_level_requests); - WriteParam(m, p.caret_blink_interval); -} - -bool ParamTraits<RendererPreferences>::Read(const Message* m, void** iter, - param_type* p) { - if (!ReadParam(m, iter, &p->can_accept_load_drops)) - return false; - if (!ReadParam(m, iter, &p->should_antialias_text)) - return false; - - int hinting = 0; - if (!ReadParam(m, iter, &hinting)) - return false; - p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting); - - int subpixel_rendering = 0; - if (!ReadParam(m, iter, &subpixel_rendering)) - return false; - p->subpixel_rendering = - static_cast<RendererPreferencesSubpixelRenderingEnum>( - subpixel_rendering); - - int focus_ring_color; - if (!ReadParam(m, iter, &focus_ring_color)) - return false; - p->focus_ring_color = focus_ring_color; - - int thumb_active_color, thumb_inactive_color, track_color; - int active_selection_bg_color, active_selection_fg_color; - int inactive_selection_bg_color, inactive_selection_fg_color; - if (!ReadParam(m, iter, &thumb_active_color) || - !ReadParam(m, iter, &thumb_inactive_color) || - !ReadParam(m, iter, &track_color) || - !ReadParam(m, iter, &active_selection_bg_color) || - !ReadParam(m, iter, &active_selection_fg_color) || - !ReadParam(m, iter, &inactive_selection_bg_color) || - !ReadParam(m, iter, &inactive_selection_fg_color)) - return false; - p->thumb_active_color = thumb_active_color; - p->thumb_inactive_color = thumb_inactive_color; - p->track_color = track_color; - p->active_selection_bg_color = active_selection_bg_color; - p->active_selection_fg_color = active_selection_fg_color; - p->inactive_selection_bg_color = inactive_selection_bg_color; - p->inactive_selection_fg_color = inactive_selection_fg_color; - - if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) - return false; - - if (!ReadParam(m, iter, &p->caret_blink_interval)) - return false; - - return true; -} - -void ParamTraits<RendererPreferences>::Log(const param_type& p, - std::string* l) { - l->append("<RendererPreferences>"); -} - -void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { - WriteParam(m, p.standard_font_family); - WriteParam(m, p.fixed_font_family); - WriteParam(m, p.serif_font_family); - WriteParam(m, p.sans_serif_font_family); - WriteParam(m, p.cursive_font_family); - WriteParam(m, p.fantasy_font_family); - WriteParam(m, p.default_font_size); - WriteParam(m, p.default_fixed_font_size); - WriteParam(m, p.minimum_font_size); - WriteParam(m, p.minimum_logical_font_size); - WriteParam(m, p.default_encoding); - WriteParam(m, p.javascript_enabled); - WriteParam(m, p.web_security_enabled); - WriteParam(m, p.javascript_can_open_windows_automatically); - WriteParam(m, p.loads_images_automatically); - WriteParam(m, p.plugins_enabled); - WriteParam(m, p.dom_paste_enabled); - WriteParam(m, p.developer_extras_enabled); - WriteParam(m, p.inspector_settings); - WriteParam(m, p.site_specific_quirks_enabled); - WriteParam(m, p.shrinks_standalone_images_to_fit); - WriteParam(m, p.uses_universal_detector); - WriteParam(m, p.text_areas_are_resizable); - WriteParam(m, p.java_enabled); - WriteParam(m, p.allow_scripts_to_close_windows); - WriteParam(m, p.uses_page_cache); - WriteParam(m, p.remote_fonts_enabled); - WriteParam(m, p.javascript_can_access_clipboard); - WriteParam(m, p.xss_auditor_enabled); - WriteParam(m, p.local_storage_enabled); - WriteParam(m, p.databases_enabled); - WriteParam(m, p.application_cache_enabled); - WriteParam(m, p.tabs_to_links); - WriteParam(m, p.hyperlink_auditing_enabled); - WriteParam(m, p.user_style_sheet_enabled); - WriteParam(m, p.user_style_sheet_location); - WriteParam(m, p.author_and_user_styles_enabled); - WriteParam(m, p.frame_flattening_enabled); - WriteParam(m, p.allow_universal_access_from_file_urls); - WriteParam(m, p.allow_file_access_from_file_urls); - WriteParam(m, p.webaudio_enabled); - WriteParam(m, p.experimental_webgl_enabled); - WriteParam(m, p.gl_multisampling_enabled); - WriteParam(m, p.show_composited_layer_borders); - WriteParam(m, p.show_composited_layer_tree); - WriteParam(m, p.show_fps_counter); - WriteParam(m, p.accelerated_compositing_enabled); - WriteParam(m, p.force_compositing_mode); - WriteParam(m, p.composite_to_texture_enabled); - WriteParam(m, p.accelerated_2d_canvas_enabled); - WriteParam(m, p.accelerated_plugins_enabled); - WriteParam(m, p.accelerated_layers_enabled); - WriteParam(m, p.accelerated_video_enabled); - WriteParam(m, p.memory_info_enabled); - WriteParam(m, p.interactive_form_validation_enabled); - WriteParam(m, p.fullscreen_enabled); -} - -bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->standard_font_family) && - ReadParam(m, iter, &p->fixed_font_family) && - ReadParam(m, iter, &p->serif_font_family) && - ReadParam(m, iter, &p->sans_serif_font_family) && - ReadParam(m, iter, &p->cursive_font_family) && - ReadParam(m, iter, &p->fantasy_font_family) && - ReadParam(m, iter, &p->default_font_size) && - ReadParam(m, iter, &p->default_fixed_font_size) && - ReadParam(m, iter, &p->minimum_font_size) && - ReadParam(m, iter, &p->minimum_logical_font_size) && - ReadParam(m, iter, &p->default_encoding) && - ReadParam(m, iter, &p->javascript_enabled) && - ReadParam(m, iter, &p->web_security_enabled) && - ReadParam(m, iter, &p->javascript_can_open_windows_automatically) && - ReadParam(m, iter, &p->loads_images_automatically) && - ReadParam(m, iter, &p->plugins_enabled) && - ReadParam(m, iter, &p->dom_paste_enabled) && - ReadParam(m, iter, &p->developer_extras_enabled) && - ReadParam(m, iter, &p->inspector_settings) && - ReadParam(m, iter, &p->site_specific_quirks_enabled) && - ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) && - ReadParam(m, iter, &p->uses_universal_detector) && - ReadParam(m, iter, &p->text_areas_are_resizable) && - ReadParam(m, iter, &p->java_enabled) && - ReadParam(m, iter, &p->allow_scripts_to_close_windows) && - ReadParam(m, iter, &p->uses_page_cache) && - ReadParam(m, iter, &p->remote_fonts_enabled) && - ReadParam(m, iter, &p->javascript_can_access_clipboard) && - ReadParam(m, iter, &p->xss_auditor_enabled) && - ReadParam(m, iter, &p->local_storage_enabled) && - ReadParam(m, iter, &p->databases_enabled) && - ReadParam(m, iter, &p->application_cache_enabled) && - ReadParam(m, iter, &p->tabs_to_links) && - ReadParam(m, iter, &p->hyperlink_auditing_enabled) && - ReadParam(m, iter, &p->user_style_sheet_enabled) && - ReadParam(m, iter, &p->user_style_sheet_location) && - ReadParam(m, iter, &p->author_and_user_styles_enabled) && - ReadParam(m, iter, &p->frame_flattening_enabled) && - ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && - ReadParam(m, iter, &p->allow_file_access_from_file_urls) && - ReadParam(m, iter, &p->webaudio_enabled) && - ReadParam(m, iter, &p->experimental_webgl_enabled) && - ReadParam(m, iter, &p->gl_multisampling_enabled) && - ReadParam(m, iter, &p->show_composited_layer_borders) && - ReadParam(m, iter, &p->show_composited_layer_tree) && - ReadParam(m, iter, &p->show_fps_counter) && - ReadParam(m, iter, &p->accelerated_compositing_enabled) && - ReadParam(m, iter, &p->force_compositing_mode) && - ReadParam(m, iter, &p->composite_to_texture_enabled) && - ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && - ReadParam(m, iter, &p->accelerated_plugins_enabled) && - ReadParam(m, iter, &p->accelerated_layers_enabled) && - ReadParam(m, iter, &p->accelerated_video_enabled) && - ReadParam(m, iter, &p->memory_info_enabled) && - ReadParam(m, iter, &p->interactive_form_validation_enabled) && - ReadParam(m, iter, &p->fullscreen_enabled); -} - -void ParamTraits<WebPreferences>::Log(const param_type& p, std::string* l) { - l->append("<WebPreferences>"); -} - void ParamTraits<WebDropData>::Write(Message* m, const param_type& p) { WriteParam(m, p.url); WriteParam(m, p.url_title); diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 9b9d15b..aa32707 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -23,7 +23,6 @@ #include "build/build_config.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/content_settings.h" -#include "chrome/common/css_colors.h" #include "chrome/common/edit_command.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_extent.h" @@ -38,6 +37,7 @@ #include "chrome/common/webkit_param_traits.h" #include "chrome/common/window_container_type.h" #include "content/common/common_param_traits.h" +#include "content/common/css_colors.h" #include "content/common/notification_type.h" #include "content/common/page_transition_types.h" #include "content/common/page_zoom.h" @@ -156,39 +156,6 @@ struct ParamTraits<webkit::npapi::WebPluginInfo> { static void Log(const param_type& p, std::string* l); }; -// Traits for reading/writing CSS Colors -template <> -struct ParamTraits<CSSColors::CSSColorName> { - typedef CSSColors::CSSColorName param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p)); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, reinterpret_cast<int*>(p)); - } - static void Log(const param_type& p, std::string* l) { - l->append("<CSSColorName>"); - } -}; - -// Traits for RendererPreferences structure to pack/unpack. -template <> -struct ParamTraits<RendererPreferences> { - typedef RendererPreferences 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); -}; - -// Traits for WebPreferences structure to pack/unpack. -template <> -struct ParamTraits<WebPreferences> { - typedef WebPreferences 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); -}; - // Traits for WebDropData template <> struct ParamTraits<WebDropData> { @@ -293,38 +260,12 @@ struct ParamTraits<webkit_glue::WebAccessibility> { #endif // CHROME_COMMON_RENDER_MESSAGES_H_ -#define IPC_MESSAGE_START ViewMsgStart +#define IPC_MESSAGE_START ChromeMsgStart //----------------------------------------------------------------------------- // RenderView messages // These are messages sent from the browser to the renderer process. -// Used typically when recovering from a crash. The new rendering process -// sets its global "next page id" counter to the given value. -IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID, - int32 /* next_page_id */) - -// Sends System Colors corresponding to a set of CSS color keywords -// down the pipe. -// This message must be sent to the renderer immediately on launch -// before creating any new views. -// The message can also be sent during a renderer's lifetime if system colors -// are updated. -// TODO(jeremy): Possibly change IPC format once we have this all hooked up. -IPC_MESSAGE_ROUTED1(ViewMsg_SetCSSColors, - std::vector<CSSColors::CSSColorMapping>) - -// Asks the browser for a unique routing ID. -IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID, - int /* routing_id */) - -// Tells the renderer to create a new view. -// This message is slightly different, the view it takes (via -// ViewMsg_New_Params) is the view to create, the message itself is sent as a -// non-view control message. -IPC_MESSAGE_CONTROL1(ViewMsg_New, - ViewMsg_New_Params) - // Tells the renderer to set its maximum cache size to the supplied value. IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, size_t /* min_dead_capacity */, @@ -334,16 +275,6 @@ IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, // Tells the renderer to clear the cache. IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) -// Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget. -// similar to the new command, but used when the renderer created a view -// first, and we need to update it. -IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK, - gfx::NativeViewId /* parent_hwnd */) - -// Sends updated preferences to the renderer. -IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs, - RendererPreferences) - // Tells the renderer to perform the given action on the media player // located at the given point. IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt, @@ -719,9 +650,6 @@ IPC_MESSAGE_ROUTED4( IPC_MESSAGE_ROUTED1(ViewMsg_ImeConfirmComposition, string16 /* text */) -// This passes a set of webkit preferences down to the renderer. -IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences, WebPreferences) - // Used to notify the render-view that the browser has received a reply for // the Find operation and is interested in receiving the next one. This is // used to prevent the renderer from spamming the browser process with diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index d91ab9f..da547af 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -190,15 +190,6 @@ ViewHostMsg_CreateWorker_Params::ViewHostMsg_CreateWorker_Params() ViewHostMsg_CreateWorker_Params::~ViewHostMsg_CreateWorker_Params() { } -ViewMsg_New_Params::ViewMsg_New_Params() - : parent_window(0), - view_id(0), - session_storage_namespace_id(0) { -} - -ViewMsg_New_Params::~ViewMsg_New_Params() { -} - ViewHostMsg_CreateWindow_Params::ViewHostMsg_CreateWindow_Params() : opener_id(0), user_gesture(false), @@ -1055,43 +1046,6 @@ void ParamTraits<ViewHostMsg_CreateWorker_Params>::Log(const param_type& p, l->append(")"); } -void ParamTraits<ViewMsg_New_Params>::Write(Message* m, const param_type& p) { - WriteParam(m, p.parent_window); - WriteParam(m, p.renderer_preferences); - WriteParam(m, p.web_preferences); - WriteParam(m, p.view_id); - WriteParam(m, p.session_storage_namespace_id); - WriteParam(m, p.frame_name); -} - -bool ParamTraits<ViewMsg_New_Params>::Read(const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->parent_window) && - ReadParam(m, iter, &p->renderer_preferences) && - ReadParam(m, iter, &p->web_preferences) && - ReadParam(m, iter, &p->view_id) && - ReadParam(m, iter, &p->session_storage_namespace_id) && - ReadParam(m, iter, &p->frame_name); -} - -void ParamTraits<ViewMsg_New_Params>::Log(const param_type& p, std::string* l) { - l->append("("); - LogParam(p.parent_window, l); - l->append(", "); - LogParam(p.renderer_preferences, l); - l->append(", "); - LogParam(p.web_preferences, l); - l->append(", "); - LogParam(p.view_id, l); - l->append(", "); - LogParam(p.session_storage_namespace_id, l); - l->append(", "); - LogParam(p.frame_name, l); - l->append(")"); -} - void ParamTraits<ViewHostMsg_CreateWindow_Params>::Write(Message* m, const param_type& p) { WriteParam(m, p.opener_id); diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index 4fe75b2..58dbd66 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -22,7 +22,6 @@ #include "content/common/navigation_gesture.h" #include "content/common/navigation_types.h" #include "content/common/page_transition_types.h" -#include "content/common/renderer_preferences.h" #include "content/common/serialized_script_value.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_param_traits.h" @@ -32,7 +31,6 @@ #include "webkit/glue/password_form.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webmenuitem.h" -#include "webkit/glue/webpreferences.h" #include "webkit/plugins/npapi/webplugin.h" // TODO(erg): Split this file into $1_db_params.h, $1_audio_params.h, @@ -618,30 +616,6 @@ struct ViewHostMsg_CreateWorker_Params { int64 script_resource_appcache_id; }; -// Creates a new view via a control message since the view doesn't yet exist. -struct ViewMsg_New_Params { - ViewMsg_New_Params(); - ~ViewMsg_New_Params(); - - // The parent window's id. - gfx::NativeViewId parent_window; - - // Renderer-wide preferences. - RendererPreferences renderer_preferences; - - // Preferences for this view. - WebPreferences web_preferences; - - // The ID of the view to be created. - int32 view_id; - - // The session storage namespace ID this view should use. - int64 session_storage_namespace_id; - - // The name of the frame associated with this view (or empty if none). - string16 frame_name; -}; - struct ViewHostMsg_CreateWindow_Params { ViewHostMsg_CreateWindow_Params(); ~ViewHostMsg_CreateWindow_Params(); @@ -952,14 +926,6 @@ struct ParamTraits<ViewHostMsg_CreateWorker_Params> { }; template<> -struct ParamTraits<ViewMsg_New_Params> { - typedef ViewMsg_New_Params 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); -}; - -template<> struct ParamTraits<ViewHostMsg_CreateWindow_Params> { typedef ViewHostMsg_CreateWindow_Params param_type; static void Write(Message* m, const param_type& p); diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 2b6fefa..7d38a80 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -58,6 +58,7 @@ #include "content/common/renderer_preferences.h" #include "content/common/resource_dispatcher.h" #include "content/common/resource_messages.h" +#include "content/common/view_messages.h" #include "content/common/web_database_observer_impl.h" #include "content/plugin/npobject_util.h" #include "content/renderer/cookie_message_filter.h" diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index eed5c65..8df21e8 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -14,10 +14,10 @@ #include "base/time.h" #include "base/timer.h" #include "build/build_config.h" -#include "chrome/common/css_colors.h" #include "chrome/common/extensions/extension_set.h" #include "chrome/renderer/visitedlink_slave.h" #include "content/common/child_thread.h" +#include "content/common/css_colors.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_platform_file.h" #include "ui/gfx/native_widget_types.h" diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc index 504431a..3659772 100644 --- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc +++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc @@ -19,6 +19,7 @@ #include "content/common/resource_messages.h" #include "content/common/resource_response.h" #include "content/common/sandbox_init_wrapper.h" +#include "content/common/view_messages.h" #include "content/renderer/render_view.h" #include "googleurl/src/gurl.h" #include "net/base/upload_data.h" diff --git a/chrome/tools/ipclist/all_messages.h b/chrome/tools/ipclist/all_messages.h index 79b6b98..af80dd9 100644 --- a/chrome/tools/ipclist/all_messages.h +++ b/chrome/tools/ipclist/all_messages.h @@ -19,9 +19,12 @@ #include "content/common/child_process_messages.h" #include "content/common/clipboard_messages.h" #include "content/common/database_messages.h" +#include "content/common/desktop_notification_messages.h" +#include "content/common/device_orientation_messages.h" #include "content/common/dom_storage_messages.h" #include "content/common/file_system_messages.h" #include "content/common/file_utilities_messages.h" +#include "content/common/geolocation_messages.h" #include "content/common/gpu_messages.h" #include "content/common/indexed_db_messages.h" #include "content/common/mime_registry_messages.h" @@ -32,7 +35,7 @@ #include "content/common/resource_messages.h" #include "content/common/socket_stream_messages.h" #include "content/common/speech_input_messages.h" +#include "content/common/view_messages.h" #include "content/common/webblob_messages.h" #include "content/common/worker_messages.h" #include "ppapi/proxy/ppapi_messages.h" - diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 05cbb2b..283d5bd 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -47,6 +47,7 @@ #include "content/browser/renderer_host/render_widget_helper.h" #include "content/common/desktop_notification_messages.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" #include "ipc/ipc_channel_handle.h" #include "net/base/cookie_monster.h" #include "net/base/io_buffer.h" diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 62fde16..f4100c2 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -44,6 +44,7 @@ #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "content/common/result_codes.h" +#include "content/common/view_messages.h" #include "net/base/net_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index 819a56c..2e24c3e 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -21,6 +21,7 @@ #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/result_codes.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h" #include "ui/base/keycodes/keyboard_codes.h" #include "webkit/glue/webcursor.h" diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h index 3c8448d..ba925c2 100644 --- a/content/common/content_message_generator.h +++ b/content/common/content_message_generator.h @@ -23,5 +23,6 @@ #include "content/common/resource_messages.h" #include "content/common/speech_input_messages.h" #include "content/common/socket_stream_messages.h" +#include "content/common/view_messages.h" #include "content/common/webblob_messages.h" #include "content/common/worker_messages.h" diff --git a/chrome/common/css_colors.h b/content/common/css_colors.h index cf4231d..2b79e5a 100644 --- a/chrome/common/css_colors.h +++ b/content/common/css_colors.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_CSS_COLORS_H_ -#define CHROME_COMMON_CSS_COLORS_H_ +#ifndef CONTENT_COMMON_CSS_COLORS_H_ +#define CONTENT_COMMON_CSS_COLORS_H_ #pragma once #include <utility> @@ -22,5 +22,4 @@ class CSSColors { DISALLOW_COPY_AND_ASSIGN(CSSColors); }; -#endif // CHROME_COMMON_CSS_COLORS_H_ - +#endif // CONTENT_COMMON_CSS_COLORS_H_ diff --git a/content/common/view_messages.h b/content/common/view_messages.h new file mode 100644 index 0000000..1f34df0 --- /dev/null +++ b/content/common/view_messages.h @@ -0,0 +1,157 @@ +// Copyright (c) 2011 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. + +// IPC messages for page rendering. +// Multiply-included message file, hence no include guard. + +#include "content/common/css_colors.h" +#include "content/common/renderer_preferences.h" +#include "ipc/ipc_message_macros.h" +#include "webkit/glue/webpreferences.h" + +#define IPC_MESSAGE_START ViewMsgStart + +IPC_ENUM_TRAITS(CSSColors::CSSColorName) +IPC_ENUM_TRAITS(RendererPreferencesHintingEnum) +IPC_ENUM_TRAITS(RendererPreferencesSubpixelRenderingEnum) + +IPC_STRUCT_TRAITS_BEGIN(RendererPreferences) + IPC_STRUCT_TRAITS_MEMBER(can_accept_load_drops) + IPC_STRUCT_TRAITS_MEMBER(should_antialias_text) + IPC_STRUCT_TRAITS_MEMBER(hinting) + IPC_STRUCT_TRAITS_MEMBER(subpixel_rendering) + IPC_STRUCT_TRAITS_MEMBER(focus_ring_color) + IPC_STRUCT_TRAITS_MEMBER(thumb_active_color) + IPC_STRUCT_TRAITS_MEMBER(thumb_inactive_color) + IPC_STRUCT_TRAITS_MEMBER(track_color) + IPC_STRUCT_TRAITS_MEMBER(active_selection_bg_color) + IPC_STRUCT_TRAITS_MEMBER(active_selection_fg_color) + IPC_STRUCT_TRAITS_MEMBER(inactive_selection_bg_color) + IPC_STRUCT_TRAITS_MEMBER(inactive_selection_fg_color) + IPC_STRUCT_TRAITS_MEMBER(browser_handles_top_level_requests) + IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(WebPreferences) + IPC_STRUCT_TRAITS_MEMBER(standard_font_family) + IPC_STRUCT_TRAITS_MEMBER(fixed_font_family) + IPC_STRUCT_TRAITS_MEMBER(serif_font_family) + IPC_STRUCT_TRAITS_MEMBER(sans_serif_font_family) + IPC_STRUCT_TRAITS_MEMBER(cursive_font_family) + IPC_STRUCT_TRAITS_MEMBER(fantasy_font_family) + IPC_STRUCT_TRAITS_MEMBER(default_font_size) + IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size) + IPC_STRUCT_TRAITS_MEMBER(minimum_font_size) + IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size) + IPC_STRUCT_TRAITS_MEMBER(default_encoding) + IPC_STRUCT_TRAITS_MEMBER(javascript_enabled) + IPC_STRUCT_TRAITS_MEMBER(web_security_enabled) + IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically) + IPC_STRUCT_TRAITS_MEMBER(loads_images_automatically) + IPC_STRUCT_TRAITS_MEMBER(plugins_enabled) + IPC_STRUCT_TRAITS_MEMBER(dom_paste_enabled) + IPC_STRUCT_TRAITS_MEMBER(developer_extras_enabled) + IPC_STRUCT_TRAITS_MEMBER(inspector_settings) + IPC_STRUCT_TRAITS_MEMBER(site_specific_quirks_enabled) + IPC_STRUCT_TRAITS_MEMBER(shrinks_standalone_images_to_fit) + IPC_STRUCT_TRAITS_MEMBER(uses_universal_detector) + IPC_STRUCT_TRAITS_MEMBER(text_areas_are_resizable) + IPC_STRUCT_TRAITS_MEMBER(java_enabled) + IPC_STRUCT_TRAITS_MEMBER(allow_scripts_to_close_windows) + IPC_STRUCT_TRAITS_MEMBER(uses_page_cache) + IPC_STRUCT_TRAITS_MEMBER(remote_fonts_enabled) + IPC_STRUCT_TRAITS_MEMBER(javascript_can_access_clipboard) + IPC_STRUCT_TRAITS_MEMBER(xss_auditor_enabled) + IPC_STRUCT_TRAITS_MEMBER(local_storage_enabled) + IPC_STRUCT_TRAITS_MEMBER(databases_enabled) + IPC_STRUCT_TRAITS_MEMBER(application_cache_enabled) + IPC_STRUCT_TRAITS_MEMBER(tabs_to_links) + IPC_STRUCT_TRAITS_MEMBER(hyperlink_auditing_enabled) + IPC_STRUCT_TRAITS_MEMBER(user_style_sheet_enabled) + IPC_STRUCT_TRAITS_MEMBER(user_style_sheet_location) + IPC_STRUCT_TRAITS_MEMBER(author_and_user_styles_enabled) + IPC_STRUCT_TRAITS_MEMBER(frame_flattening_enabled) + IPC_STRUCT_TRAITS_MEMBER(allow_universal_access_from_file_urls) + IPC_STRUCT_TRAITS_MEMBER(allow_file_access_from_file_urls) + IPC_STRUCT_TRAITS_MEMBER(webaudio_enabled) + IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled) + IPC_STRUCT_TRAITS_MEMBER(gl_multisampling_enabled) + IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_borders) + IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_tree) + IPC_STRUCT_TRAITS_MEMBER(show_fps_counter) + IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_enabled) + IPC_STRUCT_TRAITS_MEMBER(force_compositing_mode) + IPC_STRUCT_TRAITS_MEMBER(composite_to_texture_enabled) + IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_enabled) + IPC_STRUCT_TRAITS_MEMBER(accelerated_plugins_enabled) + IPC_STRUCT_TRAITS_MEMBER(accelerated_layers_enabled) + IPC_STRUCT_TRAITS_MEMBER(accelerated_video_enabled) + IPC_STRUCT_TRAITS_MEMBER(memory_info_enabled) + IPC_STRUCT_TRAITS_MEMBER(interactive_form_validation_enabled) + IPC_STRUCT_TRAITS_MEMBER(fullscreen_enabled) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_BEGIN(ViewMsg_New_Params) + // The parent window's id. + IPC_STRUCT_MEMBER(gfx::NativeViewId, parent_window) + + // Renderer-wide preferences. + IPC_STRUCT_MEMBER(RendererPreferences, renderer_preferences) + + // Preferences for this view. + IPC_STRUCT_MEMBER(WebPreferences, web_preferences) + + // The ID of the view to be created. + IPC_STRUCT_MEMBER(int32, view_id) + + // The session storage namespace ID this view should use. + IPC_STRUCT_MEMBER(int64, session_storage_namespace_id) + + // The name of the frame associated with this view (or empty if none). + IPC_STRUCT_MEMBER(string16, frame_name) +IPC_STRUCT_END() + +// Messages sent from the browser to the renderer. + +// Used typically when recovering from a crash. The new rendering process +// sets its global "next page id" counter to the given value. +IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID, + int32 /* next_page_id */) + +// Sends System Colors corresponding to a set of CSS color keywords +// down the pipe. +// This message must be sent to the renderer immediately on launch +// before creating any new views. +// The message can also be sent during a renderer's lifetime if system colors +// are updated. +// TODO(jeremy): Possibly change IPC format once we have this all hooked up. +IPC_MESSAGE_ROUTED1(ViewMsg_SetCSSColors, + std::vector<CSSColors::CSSColorMapping>) + +// Asks the browser for a unique routing ID. +IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID, + int /* routing_id */) + +// Tells the renderer to create a new view. +// This message is slightly different, the view it takes (via +// ViewMsg_New_Params) is the view to create, the message itself is sent as a +// non-view control message. +IPC_MESSAGE_CONTROL1(ViewMsg_New, + ViewMsg_New_Params) + +// Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget. +// similar to the new command, but used when the renderer created a view +// first, and we need to update it. +IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK, + gfx::NativeViewId /* parent_hwnd */) + +// Sends updated preferences to the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs, + RendererPreferences) + +// This passes a set of webkit preferences down to the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences, WebPreferences) + +// Messages sent from the renderer to the browser. + diff --git a/content/content_common.gypi b/content/content_common.gypi index 89dcf5f..d889966 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -26,6 +26,8 @@ 'common/appcache/appcache_dispatcher.cc', 'common/appcache/appcache_dispatcher.h', 'common/appcache_messages.h', + 'common/audio_messages.h', + 'common/audio_stream_state.h', 'common/child_process.cc', 'common/child_process.h', 'common/child_process_host.cc', @@ -53,6 +55,7 @@ 'common/content_paths.h', 'common/content_switches.cc', 'common/content_switches.h', + 'common/css_colors.h', 'common/database_messages.h', 'common/database_util.cc', 'common/database_util.h', @@ -173,6 +176,7 @@ 'common/speech_input_result.h', 'common/unix_domain_socket_posix.cc', 'common/unix_domain_socket_posix.h', + 'common/view_messages.h', 'common/web_database_observer_impl.cc', 'common/web_database_observer_impl.h', 'common/webblobregistry_impl.cc', diff --git a/content/renderer/audio_device.cc b/content/renderer/audio_device.cc index df00851..0038467 100644 --- a/content/renderer/audio_device.cc +++ b/content/renderer/audio_device.cc @@ -5,9 +5,9 @@ #include "content/renderer/audio_device.h" #include "base/singleton.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "content/common/audio_messages.h" +#include "content/common/view_messages.h" #include "media/audio/audio_util.h" scoped_refptr<AudioMessageFilter> AudioDevice::filter_; diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc index 404a5ec..e8791cd 100644 --- a/content/renderer/render_view.cc +++ b/content/renderer/render_view.cc @@ -80,6 +80,7 @@ #include "content/common/page_zoom.h" #include "content/common/pepper_messages.h" #include "content/common/renderer_preferences.h" +#include "content/common/view_messages.h" #include "content/renderer/audio_message_filter.h" #include "content/renderer/content_renderer_client.h" #include "content/renderer/device_orientation_dispatcher.h" diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 47ebd21..8ecb0b3 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -16,6 +16,7 @@ #include "chrome/common/render_messages_params.h" #include "chrome/renderer/render_process.h" #include "chrome/renderer/render_thread.h" +#include "content/common/view_messages.h" #include "content/renderer/renderer_webkitclient_impl.h" #include "gpu/common/gpu_trace_event.h" #include "ipc/ipc_sync_message.h" diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 6aaa3f3..145b23b 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -81,6 +81,7 @@ enum IPCMessageStart { DesktopNotificationMsgStart, GeolocationMsgStart, AudioMsgStart, + ChromeMsgStart, LastIPCMsgStart // Must come last. }; |