diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 22:03:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 22:03:50 +0000 |
commit | 778574e9b16cb9438b5edb364e45bd88b02b2483 (patch) | |
tree | ae51a598b2f78c08a4947c955f5e8f4f447b5e2a /content | |
parent | 87d37229ced90be38fea3443efc347068e293bc5 (diff) | |
download | chromium_src-778574e9b16cb9438b5edb364e45bd88b02b2483.zip chromium_src-778574e9b16cb9438b5edb364e45bd88b02b2483.tar.gz chromium_src-778574e9b16cb9438b5edb364e45bd88b02b2483.tar.bz2 |
Create a new message file for view related messages. I just moved a few messages initially.
TBR=tsepez
Review URL: http://codereview.chromium.org/6716007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_message_filter.cc | 1 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host.cc | 1 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host.cc | 1 | ||||
-rw-r--r-- | content/common/content_message_generator.h | 1 | ||||
-rw-r--r-- | content/common/css_colors.h | 25 | ||||
-rw-r--r-- | content/common/view_messages.h | 157 | ||||
-rw-r--r-- | content/content_common.gypi | 4 | ||||
-rw-r--r-- | content/renderer/audio_device.cc | 2 | ||||
-rw-r--r-- | content/renderer/render_view.cc | 1 | ||||
-rw-r--r-- | content/renderer/render_widget.cc | 1 |
10 files changed, 193 insertions, 1 deletions
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/content/common/css_colors.h b/content/common/css_colors.h new file mode 100644 index 0000000..2b79e5a --- /dev/null +++ b/content/common/css_colors.h @@ -0,0 +1,25 @@ +// Copyright (c) 2009 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_CSS_COLORS_H_ +#define CONTENT_COMMON_CSS_COLORS_H_ +#pragma once + +#include <utility> + +#include "base/basictypes.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" + +// Functionality related to sending the values of CSS colors to the renderer. +class CSSColors { + public: + typedef WebKit::WebColorName CSSColorName; + typedef std::pair<CSSColorName, WebKit::WebColor> CSSColorMapping; + + private: + DISALLOW_COPY_AND_ASSIGN(CSSColors); +}; + +#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" |