summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-22 01:33:53 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-22 01:33:53 +0000
commit557221548b76b970d4b70f890cb1d3165ff8257d (patch)
tree145bdab7a078d1012d480fba66f6697f9f3ecb42
parent8fb5ca734a7680739653b79d264e4997add31f05 (diff)
downloadchromium_src-557221548b76b970d4b70f890cb1d3165ff8257d.zip
chromium_src-557221548b76b970d4b70f890cb1d3165ff8257d.tar.gz
chromium_src-557221548b76b970d4b70f890cb1d3165ff8257d.tar.bz2
Move some more renderer messages to content. Also move a couple of files which should have been moved.TBR=tsepez
R=sky@chromium.org,*,jam@chromium.org,jcivelli@chromium.org,phajdan.jr@chromium.org,darin@chromium.org,brettw@chromium.org,ben@chromium.org Review URL: http://codereview.chromium.org/6718020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78957 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler.h2
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.h2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm2
-rw-r--r--chrome/chrome_renderer.gypi2
-rw-r--r--chrome/chrome_tests.gypi2
-rw-r--r--chrome/common/render_messages.cc192
-rw-r--r--chrome/common/render_messages.h165
-rw-r--r--chrome/common/render_messages_params.cc49
-rw-r--r--chrome/common/render_messages_params.h35
-rw-r--r--chrome/common/webkit_param_traits.cc39
-rw-r--r--chrome/common/webkit_param_traits.h14
-rw-r--r--chrome/renderer/blocked_plugin.cc1
-rw-r--r--chrome/renderer/mock_render_thread.cc2
-rw-r--r--chrome/renderer/page_click_tracker.cc1
-rw-r--r--chrome/test/render_view_test.cc2
-rw-r--r--content/browser/renderer_host/render_view_host.cc13
-rw-r--r--content/browser/renderer_host/render_view_host.h3
-rw-r--r--content/browser/renderer_host/render_widget_host.h2
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc2
-rw-r--r--content/common/edit_command.h (renamed from chrome/common/edit_command.h)6
-rw-r--r--content/common/view_messages.h199
-rw-r--r--content/content_common.gypi1
-rw-r--r--content/content_renderer.gypi2
-rw-r--r--content/renderer/external_popup_menu.cc (renamed from chrome/renderer/external_popup_menu.cc)5
-rw-r--r--content/renderer/external_popup_menu.h (renamed from chrome/renderer/external_popup_menu.h)7
-rw-r--r--content/renderer/external_popup_menu_unittest.cc (renamed from chrome/renderer/external_popup_menu_unittest.cc)3
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc1
-rw-r--r--content/renderer/render_view.cc2
-rw-r--r--content/renderer/render_view.h6
30 files changed, 237 insertions, 527 deletions
diff --git a/chrome/browser/renderer_host/gtk_key_bindings_handler.h b/chrome/browser/renderer_host/gtk_key_bindings_handler.h
index a33a417..9875933 100644
--- a/chrome/browser/renderer_host/gtk_key_bindings_handler.h
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler.h
@@ -11,7 +11,7 @@
#include <string>
#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
-#include "chrome/common/edit_command.h"
+#include "content/common/edit_command.h"
struct NativeWebKeyboardEvent;
diff --git a/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
index a12e3f5..e574194 100644
--- a/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
@@ -14,7 +14,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/edit_command.h"
+#include "content/common/edit_command.h"
#include "content/common/native_web_keyboard_event.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h
index a880f77..037afe2 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h
@@ -16,9 +16,9 @@
#include "chrome/browser/accessibility/browser_accessibility_delegate_mac.h"
#include "chrome/browser/accessibility/browser_accessibility_manager.h"
#include "chrome/browser/ui/cocoa/base_view.h"
-#include "chrome/common/edit_command.h"
#include "content/browser/renderer_host/accelerated_surface_container_manager_mac.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
+#include "content/common/edit_command.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "webkit/glue/webcursor.h"
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index e7793f9..fe4e952 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -24,7 +24,6 @@
#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/edit_command.h"
#include "chrome/common/render_messages.h"
#include "content/browser/browser_thread.h"
#include "content/browser/gpu_process_host.h"
@@ -33,6 +32,7 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host.h"
+#include "content/common/edit_command.h"
#include "content/common/gpu_messages.h"
#include "content/common/native_web_keyboard_event.h"
#include "content/common/plugin_messages.h"
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 7646398..9bb0139 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -66,8 +66,6 @@
'renderer/extensions/js_only_v8_extensions.h',
'renderer/extensions/renderer_extension_bindings.cc',
'renderer/extensions/renderer_extension_bindings.h',
- 'renderer/external_popup_menu.cc',
- 'renderer/external_popup_menu.h',
'renderer/loadtimes_extension_bindings.h',
'renderer/loadtimes_extension_bindings.cc',
'renderer/net/predictor_queue.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 2f472a4..1a3f1dc 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2436,8 +2436,8 @@
'../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
],
'sources': [
- 'renderer/external_popup_menu_unittest.cc',
'browser/spellcheck_message_filter_browsertest.cc',
+ '../content/renderer/external_popup_menu_unittest.cc',
],
}, { # else: OS != "mac"
'sources!': [
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index e3901c2..3b7408e 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -35,45 +35,6 @@ namespace IPC {
namespace IPC {
-template<>
-struct ParamTraits<WebMenuItem::Type> {
- typedef WebMenuItem::Type param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteInt(p);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- *p = static_cast<WebMenuItem::Type>(type);
- return true;
- }
- static void Log(const param_type& p, std::string* l) {
- std::string type;
- switch (p) {
- case WebMenuItem::OPTION:
- type = "OPTION";
- break;
- case WebMenuItem::CHECKABLE_OPTION:
- type = "CHECKABLE_OPTION";
- break;
- case WebMenuItem::GROUP:
- type = "GROUP";
- break;
- case WebMenuItem::SEPARATOR:
- type = "SEPARATOR";
- break;
- case WebMenuItem::SUBMENU:
- type = "SUBMENU";
- break;
- default:
- type = "UNKNOWN";
- break;
- }
- LogParam(type, l);
- }
-};
-
#if defined(OS_MACOSX)
void ParamTraits<FontDescriptor>::Write(Message* m, const param_type& p) {
WriteParam(m, p.font_name);
@@ -93,96 +54,6 @@ void ParamTraits<FontDescriptor>::Log(const param_type& p, std::string* l) {
}
#endif
-void ParamTraits<webkit_glue::CustomContextMenuContext>::Write(
- Message* m,
- const param_type& p) {
- WriteParam(m, p.is_pepper_menu);
- WriteParam(m, p.request_id);
-}
-
-bool ParamTraits<webkit_glue::CustomContextMenuContext>::Read(const Message* m,
- void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->is_pepper_menu) &&
- ReadParam(m, iter, &p->request_id);
-}
-
-void ParamTraits<webkit_glue::CustomContextMenuContext>::Log(
- const param_type& p,
- std::string* l) {
- l->append("(");
- LogParam(p.is_pepper_menu, l);
- l->append(", ");
- LogParam(p.request_id, l);
- l->append(")");
-}
-
-void ParamTraits<ContextMenuParams>::Write(Message* m, const param_type& p) {
- WriteParam(m, p.media_type);
- WriteParam(m, p.x);
- WriteParam(m, p.y);
- WriteParam(m, p.link_url);
- WriteParam(m, p.unfiltered_link_url);
- WriteParam(m, p.src_url);
- WriteParam(m, p.is_image_blocked);
- WriteParam(m, p.page_url);
- WriteParam(m, p.frame_url);
- WriteParam(m, p.frame_content_state);
- WriteParam(m, p.media_flags);
- WriteParam(m, p.selection_text);
- WriteParam(m, p.misspelled_word);
- WriteParam(m, p.dictionary_suggestions);
- WriteParam(m, p.spellcheck_enabled);
- WriteParam(m, p.is_editable);
-#if defined(OS_MACOSX)
- WriteParam(m, p.writing_direction_default);
- WriteParam(m, p.writing_direction_left_to_right);
- WriteParam(m, p.writing_direction_right_to_left);
-#endif // OS_MACOSX
- WriteParam(m, p.edit_flags);
- WriteParam(m, p.security_info);
- WriteParam(m, p.frame_charset);
- WriteParam(m, p.custom_context);
- WriteParam(m, p.custom_items);
-}
-
-bool ParamTraits<ContextMenuParams>::Read(const Message* m, void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->media_type) &&
- ReadParam(m, iter, &p->x) &&
- ReadParam(m, iter, &p->y) &&
- ReadParam(m, iter, &p->link_url) &&
- ReadParam(m, iter, &p->unfiltered_link_url) &&
- ReadParam(m, iter, &p->src_url) &&
- ReadParam(m, iter, &p->is_image_blocked) &&
- ReadParam(m, iter, &p->page_url) &&
- ReadParam(m, iter, &p->frame_url) &&
- ReadParam(m, iter, &p->frame_content_state) &&
- ReadParam(m, iter, &p->media_flags) &&
- ReadParam(m, iter, &p->selection_text) &&
- ReadParam(m, iter, &p->misspelled_word) &&
- ReadParam(m, iter, &p->dictionary_suggestions) &&
- ReadParam(m, iter, &p->spellcheck_enabled) &&
- ReadParam(m, iter, &p->is_editable) &&
-#if defined(OS_MACOSX)
- ReadParam(m, iter, &p->writing_direction_default) &&
- ReadParam(m, iter, &p->writing_direction_left_to_right) &&
- ReadParam(m, iter, &p->writing_direction_right_to_left) &&
-#endif // OS_MACOSX
- ReadParam(m, iter, &p->edit_flags) &&
- ReadParam(m, iter, &p->security_info) &&
- ReadParam(m, iter, &p->frame_charset) &&
- ReadParam(m, iter, &p->custom_context) &&
- ReadParam(m, iter, &p->custom_items);
-}
-
-void ParamTraits<ContextMenuParams>::Log(const param_type& p,
- std::string* l) {
- l->append("<ContextMenuParams>");
-}
-
void ParamTraits<webkit::npapi::WebPluginGeometry>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.window);
@@ -320,51 +191,6 @@ void ParamTraits<WebDropData>::Log(const param_type& p, std::string* l) {
l->append("<WebDropData>");
}
-void ParamTraits<WebMenuItem>::Write(Message* m, const param_type& p) {
- WriteParam(m, p.label);
- WriteParam(m, p.type);
- WriteParam(m, p.action);
- WriteParam(m, p.rtl);
- WriteParam(m, p.has_directional_override);
- WriteParam(m, p.enabled);
- WriteParam(m, p.checked);
- WriteParam(m, p.submenu);
-}
-
-bool ParamTraits<WebMenuItem>::Read(const Message* m,
- void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->label) &&
- ReadParam(m, iter, &p->type) &&
- ReadParam(m, iter, &p->action) &&
- ReadParam(m, iter, &p->rtl) &&
- ReadParam(m, iter, &p->has_directional_override) &&
- ReadParam(m, iter, &p->enabled) &&
- ReadParam(m, iter, &p->checked) &&
- ReadParam(m, iter, &p->submenu);
-}
-
-void ParamTraits<WebMenuItem>::Log(const param_type& p, std::string* l) {
- l->append("(");
- LogParam(p.label, l);
- l->append(", ");
- LogParam(p.type, l);
- l->append(", ");
- LogParam(p.action, l);
- l->append(", ");
- LogParam(p.rtl, l);
- l->append(", ");
- LogParam(p.has_directional_override, l);
- l->append(", ");
- LogParam(p.enabled, l);
- l->append(", ");
- LogParam(p.checked, l);
- l->append(", ");
- LogParam(p.submenu, l);
- l->append(")");
-}
-
void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) {
WriteParam(m, p.valid_schemes());
WriteParam(m, p.GetAsString());
@@ -386,24 +212,6 @@ void ParamTraits<URLPattern>::Log(const param_type& p, std::string* l) {
LogParam(p.GetAsString(), l);
}
-void ParamTraits<EditCommand>::Write(Message* m, const param_type& p) {
- WriteParam(m, p.name);
- WriteParam(m, p.value);
-}
-
-bool ParamTraits<EditCommand>::Read(const Message* m, void** iter,
- param_type* p) {
- return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value);
-}
-
-void ParamTraits<EditCommand>::Log(const param_type& p, std::string* l) {
- l->append("(");
- LogParam(p.name, l);
- l->append(":");
- LogParam(p.value, l);
- l->append(")");
-}
-
void ParamTraits<webkit_glue::WebCookie>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.name);
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index aa32707..fb631a88 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/edit_command.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_extent.h"
#include "chrome/common/extensions/url_pattern.h"
@@ -52,12 +51,10 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/rect.h"
-#include "webkit/glue/context_menu.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcookie.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webdropdata.h"
-#include "webkit/glue/webmenuitem.h"
#include "webkit/plugins/npapi/webplugin.h"
#include "webkit/plugins/npapi/webplugininfo.h"
@@ -116,22 +113,6 @@ struct ParamTraits<FontDescriptor> {
#endif
template <>
-struct ParamTraits<webkit_glue::CustomContextMenuContext> {
- typedef webkit_glue::CustomContextMenuContext 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<ContextMenuParams> {
- typedef ContextMenuParams 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<webkit::npapi::WebPluginGeometry> {
typedef webkit::npapi::WebPluginGeometry param_type;
static void Write(Message* m, const param_type& p);
@@ -190,14 +171,6 @@ struct ParamTraits<gfx::NativeView> {
#endif // defined(OS_POSIX)
-template<>
-struct ParamTraits<WebMenuItem> {
- typedef WebMenuItem 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 SimilarTypeTraits<ViewType::Type> {
typedef int Type;
@@ -212,15 +185,6 @@ struct ParamTraits<URLPattern> {
static void Log(const param_type& p, std::string* l);
};
-// Traits for EditCommand structure.
-template <>
-struct ParamTraits<EditCommand> {
- typedef EditCommand 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 WebCookie
template <>
struct ParamTraits<webkit_glue::WebCookie> {
@@ -275,11 +239,15 @@ IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities,
// Tells the renderer to clear the cache.
IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache)
-// Tells the renderer to perform the given action on the media player
-// located at the given point.
-IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt,
- gfx::Point, /* location */
- WebKit::WebMediaPlayerAction)
+// Tells the renderer to dump as much memory as it can, perhaps because we
+// have memory pressure or the renderer is (or will be) paged out. This
+// should only result in purging objects we can recalculate, e.g. caches or
+// JS garbage, not in purging irreplaceable objects.
+IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory)
+
+// Tells the render view to capture a thumbnail image of the page. The
+// render view responds with a ViewHostMsg_Snapshot.
+IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot)
IPC_MESSAGE_ROUTED0(ViewMsg_PrintNodeUnderContextMenu)
@@ -288,38 +256,6 @@ IPC_MESSAGE_ROUTED0(ViewMsg_PrintNodeUnderContextMenu)
IPC_MESSAGE_ROUTED1(ViewMsg_PrintForPrintPreview,
DictionaryValue /* settings*/)
-// Tells the render view to close.
-IPC_MESSAGE_ROUTED0(ViewMsg_Close)
-
-// Tells the render view to change its size. A ViewHostMsg_PaintRect message
-// is generated in response provided new_size is not empty and not equal to
-// the view's current size. The generated ViewHostMsg_PaintRect message will
-// have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that
-// we don't have to fetch it every time WebKit asks for it.
-IPC_MESSAGE_ROUTED2(ViewMsg_Resize,
- gfx::Size /* new_size */,
- gfx::Rect /* resizer_rect */)
-
-// Sent to inform the view that it was hidden. This allows it to reduce its
-// resource utilization.
-IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden)
-
-// Tells the render view that it is no longer hidden (see WasHidden), and the
-// render view is expected to respond with a full repaint if needs_repainting
-// is true. In that case, the generated ViewHostMsg_PaintRect message will
-// have the IS_RESTORE_ACK flag set. If needs_repainting is false, then this
-// message does not trigger a message in response.
-IPC_MESSAGE_ROUTED1(ViewMsg_WasRestored,
- bool /* needs_repainting */)
-
-// Tells the render view to capture a thumbnail image of the page. The
-// render view responds with a ViewHostMsg_Thumbnail.
-IPC_MESSAGE_ROUTED0(ViewMsg_CaptureThumbnail)
-
-// Tells the render view to capture a thumbnail image of the page. The
-// render view responds with a ViewHostMsg_Snapshot.
-IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot)
-
// Tells the render view to switch the CSS to print media type, renders every
// requested pages and switch back the CSS to display media type.
IPC_MESSAGE_ROUTED0(ViewMsg_PrintPages)
@@ -343,69 +279,6 @@ IPC_MESSAGE_ROUTED0(ViewMsg_ResetScriptedPrintCount)
IPC_MESSAGE_ROUTED1(ViewHostMsg_PagesReadyForPreview,
ViewHostMsg_DidPreviewDocument_Params /* params */)
-// Tells the renderer to dump as much memory as it can, perhaps because we
-// have memory pressure or the renderer is (or will be) paged out. This
-// should only result in purging objects we can recalculate, e.g. caches or
-// JS garbage, not in purging irreplaceable objects.
-IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory)
-
-// Sent to render the view into the supplied transport DIB, resize
-// the web widget to match the |page_size|, scale it by the
-// appropriate scale to make it fit the |desired_size|, and return
-// it. In response to this message, the host generates a
-// ViewHostMsg_PaintAtSize_ACK message. Note that the DIB *must* be
-// the right size to receive an RGBA image at the |desired_size|.
-// |tag| is sent along with ViewHostMsg_PaintAtSize_ACK unmodified to
-// identify the PaintAtSize message the ACK belongs to.
-IPC_MESSAGE_ROUTED4(ViewMsg_PaintAtSize,
- TransportDIB::Handle /* dib_handle */,
- int /* tag */,
- gfx::Size /* page_size */,
- gfx::Size /* desired_size */)
-
-// Tells the render view that a ViewHostMsg_UpdateRect message was processed.
-// This signals the render view that it can send another UpdateRect message.
-IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK)
-
-// Message payload includes:
-// 1. A blob that should be cast to WebInputEvent
-// 2. An optional boolean value indicating if a RawKeyDown event is associated
-// to a keyboard shortcut of the browser.
-IPC_MESSAGE_ROUTED0(ViewMsg_HandleInputEvent)
-
-// This message notifies the renderer that the next key event is bound to one
-// or more pre-defined edit commands. If the next key event is not handled
-// by webkit, the specified edit commands shall be executed against current
-// focused frame.
-// Parameters
-// * edit_commands (see chrome/common/edit_command_types.h)
-// Contains one or more edit commands.
-// See third_party/WebKit/Source/WebCore/editing/EditorCommand.cpp for detailed
-// definition of webkit edit commands.
-//
-// This message must be sent just before sending a key event.
-IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent,
- std::vector<EditCommand> /* edit_commands */)
-
-// Message payload is the name/value of a WebCore edit command to execute.
-IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand,
- std::string, /* name */
- std::string /* value */)
-
-IPC_MESSAGE_ROUTED0(ViewMsg_MouseCaptureLost)
-
-// TODO(darin): figure out how this meshes with RestoreFocus
-IPC_MESSAGE_ROUTED1(ViewMsg_SetFocus, bool /* enable */)
-
-// Tells the renderer to focus the first (last if reverse is true) focusable
-// node.
-IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus, bool /* reverse */)
-
-// Tells the renderer to scroll the currently focused node into view only if
-// the currently focused node is a Text node (textfield, text area or content
-// editable divs).
-IPC_MESSAGE_ROUTED0(ViewMsg_ScrollFocusedEditableNodeIntoView)
-
// Tells the renderer to perform the specified navigation, interrupting any
// existing navigation.
IPC_MESSAGE_ROUTED1(ViewMsg_Navigate, ViewMsg_Navigate_Params)
@@ -930,11 +803,6 @@ IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_WordAdded,
IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_EnableAutoSpellCorrect,
bool /* enable */)
-// Executes custom context menu action that was provided from WebKit.
-IPC_MESSAGE_ROUTED2(ViewMsg_CustomContextMenuAction,
- webkit_glue::CustomContextMenuContext /* custom_context */,
- unsigned /* action */)
-
// Tells the renderer to translate the page contents from one language to
// another.
IPC_MESSAGE_ROUTED4(ViewMsg_TranslatePage,
@@ -994,11 +862,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_StartPhishingDetection, GURL)
IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
int /* selected index, -1 means no selection */)
-// Sent in response to a ViewHostMsg_ContextMenu to let the renderer know that
-// the menu has been closed.
-IPC_MESSAGE_ROUTED1(ViewMsg_ContextMenuClosed,
- webkit_glue::CustomContextMenuContext /* custom_context */)
-
// Tells the renderer that the network state has changed and that
// window.navigator.onLine should be updated for all WebViews.
IPC_MESSAGE_ROUTED1(ViewMsg_NetworkStateChanged,
@@ -1052,10 +915,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget,
IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget,
int /* route_id */)
-// Message to show a popup menu using native cocoa controls (Mac only).
-IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowPopup,
- ViewHostMsg_ShowPopup_Params)
-
// 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)
@@ -1395,12 +1254,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFaviconURL,
int32 /* page_id */,
GURL /* url of the favicon */)
-// 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
-// user right clicked.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams)
-
// Requests that the given URL be opened in the specified manner.
IPC_MESSAGE_ROUTED3(ViewHostMsg_OpenURL,
GURL /* url */,
diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc
index 5b6d360..b9562ee 100644
--- a/chrome/common/render_messages_params.cc
+++ b/chrome/common/render_messages_params.cc
@@ -141,16 +141,6 @@ ViewHostMsg_DidPrintPage_Params::ViewHostMsg_DidPrintPage_Params()
ViewHostMsg_DidPrintPage_Params::~ViewHostMsg_DidPrintPage_Params() {
}
-ViewHostMsg_ShowPopup_Params::ViewHostMsg_ShowPopup_Params()
- : item_height(0),
- item_font_size(0),
- selected_item(0),
- right_aligned(false) {
-}
-
-ViewHostMsg_ShowPopup_Params::~ViewHostMsg_ShowPopup_Params() {
-}
-
ViewHostMsg_ScriptedPrint_Params::ViewHostMsg_ScriptedPrint_Params()
: routing_id(0),
host_window_id(0),
@@ -899,45 +889,6 @@ void ParamTraits<ViewHostMsg_DidPrintPage_Params>::Log(const param_type& p,
l->append("<ViewHostMsg_DidPrintPage_Params>");
}
-void ParamTraits<ViewHostMsg_ShowPopup_Params>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, p.bounds);
- WriteParam(m, p.item_height);
- WriteParam(m, p.item_font_size);
- WriteParam(m, p.selected_item);
- WriteParam(m, p.popup_items);
- WriteParam(m, p.right_aligned);
-}
-
-bool ParamTraits<ViewHostMsg_ShowPopup_Params>::Read(const Message* m,
- void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->bounds) &&
- ReadParam(m, iter, &p->item_height) &&
- ReadParam(m, iter, &p->item_font_size) &&
- ReadParam(m, iter, &p->selected_item) &&
- ReadParam(m, iter, &p->popup_items) &&
- ReadParam(m, iter, &p->right_aligned);
-}
-
-void ParamTraits<ViewHostMsg_ShowPopup_Params>::Log(const param_type& p,
- std::string* l) {
- l->append("(");
- LogParam(p.bounds, l);
- l->append(", ");
- LogParam(p.item_height, l);
- l->append(", ");
- LogParam(p.item_font_size, l);
- l->append(", ");
- LogParam(p.selected_item, l);
- l->append(", ");
- LogParam(p.popup_items, l);
- l->append(", ");
- LogParam(p.right_aligned, l);
- l->append(")");
-}
-
void ParamTraits<ViewHostMsg_ScriptedPrint_Params>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.routing_id);
diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h
index 58dbd66..c5337c6 100644
--- a/chrome/common/render_messages_params.h
+++ b/chrome/common/render_messages_params.h
@@ -30,7 +30,6 @@
#include "ui/gfx/size.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/webaccessibility.h"
-#include "webkit/glue/webmenuitem.h"
#include "webkit/plugins/npapi/webplugin.h"
// TODO(erg): Split this file into $1_db_params.h, $1_audio_params.h,
@@ -520,32 +519,6 @@ struct ViewHostMsg_DidPrintPage_Params {
bool has_visible_overlays;
};
-// 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.
-struct ViewHostMsg_ShowPopup_Params {
- ViewHostMsg_ShowPopup_Params();
- ~ViewHostMsg_ShowPopup_Params();
-
- // Position on the screen.
- gfx::Rect bounds;
-
- // The height of each item in the menu.
- int item_height;
-
- // The size of the font to use for those items.
- double item_font_size;
-
- // The currently selected (displayed) item in the menu.
- int selected_item;
-
- // The entire list of items in the popup menu.
- std::vector<WebMenuItem> popup_items;
-
- // Whether items should be right-aligned.
- bool right_aligned;
-};
-
// Parameters for the IPC message ViewHostMsg_ScriptedPrint
struct ViewHostMsg_ScriptedPrint_Params {
ViewHostMsg_ScriptedPrint_Params();
@@ -894,14 +867,6 @@ struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
};
template <>
-struct ParamTraits<ViewHostMsg_ShowPopup_Params> {
- typedef ViewHostMsg_ShowPopup_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_ScriptedPrint_Params> {
typedef ViewHostMsg_ScriptedPrint_Params param_type;
static void Write(Message* m, const param_type& p);
diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc
index 294ef5c..7abeef4 100644
--- a/chrome/common/webkit_param_traits.cc
+++ b/chrome/common/webkit_param_traits.cc
@@ -7,7 +7,6 @@
#include "base/format_macros.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/WebScreenInfo.h"
namespace IPC {
@@ -106,44 +105,6 @@ void ParamTraits<WebKit::WebCache::ResourceTypeStat>::Log(
p.count, p.size, p.liveSize, p.decodedSize));
}
-void ParamTraits<WebKit::WebMediaPlayerAction>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, static_cast<int>(p.type));
- WriteParam(m, p.enable);
-}
-
-bool ParamTraits<WebKit::WebMediaPlayerAction>::Read(const Message* m,
- void** iter,
- param_type* r) {
- int temp;
- if (!ReadParam(m, iter, &temp))
- return false;
- r->type = static_cast<param_type::Type>(temp);
- return ReadParam(m, iter, &r->enable);
-}
-
-void ParamTraits<WebKit::WebMediaPlayerAction>::Log(const param_type& p,
- std::string* l) {
- l->append("(");
- switch (p.type) {
- case WebKit::WebMediaPlayerAction::Play:
- l->append("Play");
- break;
- case WebKit::WebMediaPlayerAction::Mute:
- l->append("Mute");
- break;
- case WebKit::WebMediaPlayerAction::Loop:
- l->append("Loop");
- break;
- default:
- l->append("Unknown");
- break;
- }
- l->append(", ");
- LogParam(p.enable, l);
- l->append(")");
-}
-
void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.startOffset);
diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h
index 6d66112..dd7e512 100644
--- a/chrome/common/webkit_param_traits.h
+++ b/chrome/common/webkit_param_traits.h
@@ -37,7 +37,6 @@
namespace WebKit {
struct WebCompositionUnderline;
struct WebFindOptions;
-struct WebMediaPlayerAction;
struct WebRect;
struct WebScreenInfo;
}
@@ -157,19 +156,6 @@ struct SimilarTypeTraits<WebKit::WebDragOperation> {
};
template <>
-struct ParamTraits<WebKit::WebMediaPlayerAction> {
- typedef WebKit::WebMediaPlayerAction param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
- static void Log(const param_type& p, std::string* l);
-};
-
-template <>
-struct SimilarTypeTraits<WebKit::WebContextMenuData::MediaType> {
- typedef int Type;
-};
-
-template <>
struct ParamTraits<WebKit::WebCompositionUnderline> {
typedef WebKit::WebCompositionUnderline param_type;
static void Write(Message* m, const param_type& p);
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc
index e3c21f8..879de9b 100644
--- a/chrome/renderer/blocked_plugin.cc
+++ b/chrome/renderer/blocked_plugin.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/render_messages.h"
+#include "content/common/view_messages.h"
#include "content/renderer/render_view.h"
#include "grit/generated_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 1623749..8f9d428 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -9,8 +9,8 @@
#include "base/file_util.h"
#include "base/process_util.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/common/url_constants.h"
+#include "content/common/view_messages.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_sync_message.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/renderer/page_click_tracker.cc b/chrome/renderer/page_click_tracker.cc
index 5213dbd..c7ef581 100644
--- a/chrome/renderer/page_click_tracker.cc
+++ b/chrome/renderer/page_click_tracker.cc
@@ -6,6 +6,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/renderer/page_click_listener.h"
+#include "content/common/view_messages.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMouseEvent.h"
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc
index de4364b..46f48f9 100644
--- a/chrome/test/render_view_test.cc
+++ b/chrome/test/render_view_test.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/autofill/autofill_agent.h"
#include "chrome/renderer/autofill/password_autofill_manager.h"
#include "chrome/renderer/extensions/event_bindings.h"
@@ -19,6 +18,7 @@
#include "content/common/dom_storage_common.h"
#include "content/common/native_web_keyboard_event.h"
#include "content/common/renderer_preferences.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/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index f4100c2..8739121 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -561,10 +561,6 @@ void RenderViewHost::GetApplicationInfo(int32 page_id) {
Send(new ViewMsg_GetApplicationInfo(routing_id(), page_id));
}
-void RenderViewHost::CaptureThumbnail() {
- Send(new ViewMsg_CaptureThumbnail(routing_id()));
-}
-
void RenderViewHost::CaptureSnapshot() {
Send(new ViewMsg_CaptureSnapshot(routing_id()));
}
@@ -1441,17 +1437,12 @@ void RenderViewHost::ForwardKeyboardEvent(
void RenderViewHost::ForwardEditCommand(const std::string& name,
const std::string& value) {
- IPC::Message* message = new ViewMsg_ExecuteEditCommand(routing_id(),
- name,
- value);
- Send(message);
+ Send(new ViewMsg_ExecuteEditCommand(routing_id(), name, value));
}
void RenderViewHost::ForwardEditCommandsForNextKeyEvent(
const EditCommands& edit_commands) {
- IPC::Message* message = new ViewMsg_SetEditCommandsForNextKeyEvent(
- routing_id(), edit_commands);
- Send(message);
+ Send(new ViewMsg_SetEditCommandsForNextKeyEvent(routing_id(), edit_commands));
}
void RenderViewHost::ForwardMessageFromExternalHost(const std::string& message,
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index d0a0aa9..48eea5b 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -302,9 +302,6 @@ class RenderViewHost : public RenderWidgetHost {
// the data is available.
void GetApplicationInfo(int32 page_id);
- // Captures a thumbnail representation of the page.
- void CaptureThumbnail();
-
// Captures a snapshot of the page.
void CaptureSnapshot();
diff --git a/content/browser/renderer_host/render_widget_host.h b/content/browser/renderer_host/render_widget_host.h
index 61021c1..11cc45d 100644
--- a/content/browser/renderer_host/render_widget_host.h
+++ b/content/browser/renderer_host/render_widget_host.h
@@ -16,7 +16,7 @@
#include "base/scoped_ptr.h"
#include "base/string16.h"
#include "base/timer.h"
-#include "chrome/common/edit_command.h"
+#include "content/common/edit_command.h"
#include "content/common/native_web_keyboard_event.h"
#include "content/common/property_bag.h"
#include "ipc/ipc_channel.h"
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index d708bed..39a05fb 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -8,12 +8,12 @@
#include "base/timer.h"
#include "build/build_config.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/backing_store.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
+#include "content/common/view_messages.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas_skia.h"
diff --git a/chrome/common/edit_command.h b/content/common/edit_command.h
index f9acb14..660cbda 100644
--- a/chrome/common/edit_command.h
+++ b/content/common/edit_command.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_EDIT_COMMAND_H_
-#define CHROME_COMMON_EDIT_COMMAND_H_
+#ifndef CONTENT_COMMON_EDIT_COMMAND_H_
+#define CONTENT_COMMON_EDIT_COMMAND_H_
#pragma once
#include <string>
@@ -22,4 +22,4 @@ struct EditCommand {
typedef std::vector<EditCommand> EditCommands;
-#endif // CHROME_COMMON_EDIT_COMMAND_H_
+#endif // CONTENT_COMMON_EDIT_COMMAND_H_
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 1f34df0..6ce89e9 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -5,9 +5,15 @@
// IPC messages for page rendering.
// Multiply-included message file, hence no include guard.
+#include "content/common/common_param_traits.h"
#include "content/common/css_colors.h"
+#include "content/common/edit_command.h"
#include "content/common/renderer_preferences.h"
#include "ipc/ipc_message_macros.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h"
+#include "ui/gfx/rect.h"
+#include "webkit/glue/context_menu.h"
+#include "webkit/glue/webmenuitem.h"
#include "webkit/glue/webpreferences.h"
#define IPC_MESSAGE_START ViewMsgStart
@@ -15,6 +21,14 @@
IPC_ENUM_TRAITS(CSSColors::CSSColorName)
IPC_ENUM_TRAITS(RendererPreferencesHintingEnum)
IPC_ENUM_TRAITS(RendererPreferencesSubpixelRenderingEnum)
+IPC_ENUM_TRAITS(WebKit::WebContextMenuData::MediaType)
+IPC_ENUM_TRAITS(WebKit::WebMediaPlayerAction::Type)
+IPC_ENUM_TRAITS(WebMenuItem::Type)
+
+IPC_STRUCT_TRAITS_BEGIN(EditCommand)
+ IPC_STRUCT_TRAITS_MEMBER(name)
+ IPC_STRUCT_TRAITS_MEMBER(value)
+IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(RendererPreferences)
IPC_STRUCT_TRAITS_MEMBER(can_accept_load_drops)
@@ -33,6 +47,11 @@ IPC_STRUCT_TRAITS_BEGIN(RendererPreferences)
IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval)
IPC_STRUCT_TRAITS_END()
+IPC_STRUCT_TRAITS_BEGIN(WebKit::WebMediaPlayerAction)
+ IPC_STRUCT_TRAITS_MEMBER(type)
+ IPC_STRUCT_TRAITS_MEMBER(enable)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_TRAITS_BEGIN(WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(standard_font_family)
IPC_STRUCT_TRAITS_MEMBER(fixed_font_family)
@@ -92,6 +111,74 @@ IPC_STRUCT_TRAITS_BEGIN(WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(fullscreen_enabled)
IPC_STRUCT_TRAITS_END()
+IPC_STRUCT_TRAITS_BEGIN(WebMenuItem)
+ IPC_STRUCT_TRAITS_MEMBER(label)
+ IPC_STRUCT_TRAITS_MEMBER(type)
+ IPC_STRUCT_TRAITS_MEMBER(action)
+ IPC_STRUCT_TRAITS_MEMBER(rtl)
+ IPC_STRUCT_TRAITS_MEMBER(has_directional_override)
+ IPC_STRUCT_TRAITS_MEMBER(enabled)
+ IPC_STRUCT_TRAITS_MEMBER(checked)
+ IPC_STRUCT_TRAITS_MEMBER(submenu)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(webkit_glue::CustomContextMenuContext)
+ IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu)
+ 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_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.
+IPC_STRUCT_BEGIN(ViewHostMsg_ShowPopup_Params)
+ // Position on the screen.
+ IPC_STRUCT_MEMBER(gfx::Rect, bounds)
+
+ // The height of each item in the menu.
+ IPC_STRUCT_MEMBER(int, item_height)
+
+ // The size of the font to use for those items.
+ IPC_STRUCT_MEMBER(double, item_font_size)
+
+ // The currently selected (displayed) item in the menu.
+ IPC_STRUCT_MEMBER(int, selected_item)
+
+ // The entire list of items in the popup menu.
+ IPC_STRUCT_MEMBER(std::vector<WebMenuItem>, popup_items)
+
+ // Whether items should be right-aligned.
+ IPC_STRUCT_MEMBER(bool, right_aligned)
+IPC_STRUCT_END()
+
IPC_STRUCT_BEGIN(ViewMsg_New_Params)
// The parent window's id.
IPC_STRUCT_MEMBER(gfx::NativeViewId, parent_window)
@@ -151,7 +238,117 @@ IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs,
RendererPreferences)
// This passes a set of webkit preferences down to the renderer.
-IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences, WebPreferences)
+IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
+ WebPreferences)
+
+// Tells the render view to close.
+IPC_MESSAGE_ROUTED0(ViewMsg_Close)
+
+// Tells the render view to change its size. A ViewHostMsg_PaintRect message
+// is generated in response provided new_size is not empty and not equal to
+// the view's current size. The generated ViewHostMsg_PaintRect message will
+// have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that
+// we don't have to fetch it every time WebKit asks for it.
+IPC_MESSAGE_ROUTED2(ViewMsg_Resize,
+ gfx::Size /* new_size */,
+ gfx::Rect /* resizer_rect */)
+
+// Sent to inform the view that it was hidden. This allows it to reduce its
+// resource utilization.
+IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden)
+
+// Tells the render view that it is no longer hidden (see WasHidden), and the
+// render view is expected to respond with a full repaint if needs_repainting
+// is true. In that case, the generated ViewHostMsg_PaintRect message will
+// have the IS_RESTORE_ACK flag set. If needs_repainting is false, then this
+// message does not trigger a message in response.
+IPC_MESSAGE_ROUTED1(ViewMsg_WasRestored,
+ bool /* needs_repainting */)
+
+// Sent to render the view into the supplied transport DIB, resize
+// the web widget to match the |page_size|, scale it by the
+// appropriate scale to make it fit the |desired_size|, and return
+// it. In response to this message, the host generates a
+// ViewHostMsg_PaintAtSize_ACK message. Note that the DIB *must* be
+// the right size to receive an RGBA image at the |desired_size|.
+// |tag| is sent along with ViewHostMsg_PaintAtSize_ACK unmodified to
+// identify the PaintAtSize message the ACK belongs to.
+IPC_MESSAGE_ROUTED4(ViewMsg_PaintAtSize,
+ TransportDIB::Handle /* dib_handle */,
+ int /* tag */,
+ gfx::Size /* page_size */,
+ gfx::Size /* desired_size */)
+
+// Tells the render view that a ViewHostMsg_UpdateRect message was processed.
+// This signals the render view that it can send another UpdateRect message.
+IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK)
+
+// Message payload includes:
+// 1. A blob that should be cast to WebInputEvent
+// 2. An optional boolean value indicating if a RawKeyDown event is associated
+// to a keyboard shortcut of the browser.
+IPC_MESSAGE_ROUTED0(ViewMsg_HandleInputEvent)
+
+// This message notifies the renderer that the next key event is bound to one
+// or more pre-defined edit commands. If the next key event is not handled
+// by webkit, the specified edit commands shall be executed against current
+// focused frame.
+// Parameters
+// * edit_commands (see chrome/common/edit_command_types.h)
+// Contains one or more edit commands.
+// See third_party/WebKit/Source/WebCore/editing/EditorCommand.cpp for detailed
+// definition of webkit edit commands.
+//
+// This message must be sent just before sending a key event.
+IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent,
+ std::vector<EditCommand> /* edit_commands */)
+
+// Message payload is the name/value of a WebCore edit command to execute.
+IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand,
+ std::string, /* name */
+ std::string /* value */)
+
+IPC_MESSAGE_ROUTED0(ViewMsg_MouseCaptureLost)
+
+// TODO(darin): figure out how this meshes with RestoreFocus
+IPC_MESSAGE_ROUTED1(ViewMsg_SetFocus,
+ bool /* enable */)
+
+// Tells the renderer to focus the first (last if reverse is true) focusable
+// node.
+IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus,
+ bool /* reverse */)
+
+// Tells the renderer to scroll the currently focused node into view only if
+// the currently focused node is a Text node (textfield, text area or content
+// editable divs).
+IPC_MESSAGE_ROUTED0(ViewMsg_ScrollFocusedEditableNodeIntoView)
+
+// Executes custom context menu action that was provided from WebKit.
+IPC_MESSAGE_ROUTED2(ViewMsg_CustomContextMenuAction,
+ webkit_glue::CustomContextMenuContext /* custom_context */,
+ unsigned /* action */)
+
+// Sent in response to a ViewHostMsg_ContextMenu to let the renderer know that
+// the menu has been closed.
+IPC_MESSAGE_ROUTED1(ViewMsg_ContextMenuClosed,
+ webkit_glue::CustomContextMenuContext /* custom_context */)
+
+// Tells the renderer to perform the given action on the media player
+// located at the given point.
+IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt,
+ gfx::Point, /* location */
+ WebKit::WebMediaPlayerAction)
+
// Messages sent from the renderer to the browser.
+// 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
+// user right clicked.
+IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams)
+
+// Message to show a popup menu using native cocoa controls (Mac only).
+IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowPopup,
+ ViewHostMsg_ShowPopup_Params) \ No newline at end of file
diff --git a/content/content_common.gypi b/content/content_common.gypi
index d889966..56e36e0 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -69,6 +69,7 @@
'common/dom_storage_messages.h',
'common/dx_diag_node.cc',
'common/dx_diag_node.h',
+ 'common/edit_command.h',
'common/file_path_watcher/file_path_watcher.cc',
'common/file_path_watcher/file_path_watcher.h',
'common/file_path_watcher/file_path_watcher_inotify.cc',
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 0282bf3..6e37ebc 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -34,6 +34,8 @@
'renderer/cookie_message_filter.h',
'renderer/device_orientation_dispatcher.cc',
'renderer/device_orientation_dispatcher.h',
+ 'renderer/external_popup_menu.cc',
+ 'renderer/external_popup_menu.h',
'renderer/geolocation_dispatcher.cc',
'renderer/geolocation_dispatcher.h',
'renderer/ggl.cc',
diff --git a/chrome/renderer/external_popup_menu.cc b/content/renderer/external_popup_menu.cc
index fd26bbd..0fced1e 100644
--- a/chrome/renderer/external_popup_menu.cc
+++ b/content/renderer/external_popup_menu.cc
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/external_popup_menu.h"
+#include "content/renderer/external_popup_menu.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
+#include "content/common/view_messages.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenuClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
diff --git a/chrome/renderer/external_popup_menu.h b/content/renderer/external_popup_menu.h
index 2f912ce..ef83d071 100644
--- a/chrome/renderer/external_popup_menu.h
+++ b/content/renderer/external_popup_menu.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_RENDERER_EXTERNAL_POPUP_MENU_H_
-#define CHROME_RENDERER_EXTERNAL_POPUP_MENU_H_
+#ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
+#define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
#include "base/basictypes.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.h"
@@ -36,5 +36,4 @@ class ExternalPopupMenu : public WebKit::WebExternalPopupMenu {
DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu);
};
-#endif // CHROME_RENDERER_EXTERNAL_POPUP_MENU_H_
-
+#endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
diff --git a/chrome/renderer/external_popup_menu_unittest.cc b/content/renderer/external_popup_menu_unittest.cc
index 6fa7449..a2e04dd 100644
--- a/chrome/renderer/external_popup_menu_unittest.cc
+++ b/content/renderer/external_popup_menu_unittest.cc
@@ -3,9 +3,8 @@
// found in the LICENSE file.
#include "base/utf_string_conversions.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/test/render_view_test.h"
+#include "content/common/view_messages.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 6f701fb..e4ccc96 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -25,6 +25,7 @@
#include "content/common/file_system/file_system_dispatcher.h"
#include "content/common/pepper_file_messages.h"
#include "content/common/pepper_messages.h"
+#include "content/common/view_messages.h"
#include "content/renderer/audio_message_filter.h"
#include "content/renderer/command_buffer_proxy.h"
#include "content/renderer/content_renderer_client.h"
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 13a72e8..c537f11 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -82,6 +82,7 @@
#include "content/renderer/audio_message_filter.h"
#include "content/renderer/content_renderer_client.h"
#include "content/renderer/device_orientation_dispatcher.h"
+#include "content/renderer/external_popup_menu.h"
#include "content/renderer/geolocation_dispatcher.h"
#include "content/renderer/ggl.h"
#include "content/renderer/load_progress_tracker.h"
@@ -963,7 +964,6 @@ bool RenderView::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderView, message)
- IPC_MESSAGE_HANDLER(ViewMsg_CaptureThumbnail, OnCaptureThumbnail)
IPC_MESSAGE_HANDLER(ViewMsg_CaptureSnapshot, OnCaptureSnapshot)
IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate)
IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
diff --git a/content/renderer/render_view.h b/content/renderer/render_view.h
index 5166095..3842831 100644
--- a/content/renderer/render_view.h
+++ b/content/renderer/render_view.h
@@ -23,11 +23,10 @@
#include "base/weak_ptr.h"
#include "build/build_config.h"
#include "chrome/common/content_settings.h"
-#include "chrome/common/edit_command.h"
#include "chrome/common/view_types.h"
-#include "chrome/renderer/external_popup_menu.h"
#include "chrome/renderer/page_load_histograms.h"
#include "content/renderer/renderer_webcookiejar_impl.h"
+#include "content/common/edit_command.h"
#include "content/common/navigation_gesture.h"
#include "content/common/page_zoom.h"
#include "content/common/renderer_preferences.h"
@@ -59,8 +58,8 @@ class DeviceOrientationDispatcher;
class DevToolsAgent;
class DevToolsClient;
class DomAutomationController;
-class WebUIBindings;
class ExternalHostBindings;
+class ExternalPopupMenu;
class FilePath;
class GeolocationDispatcher;
class GeolocationDispatcherOld;
@@ -80,6 +79,7 @@ class SpeechInputDispatcher;
class SpellCheckProvider;
class WebPluginDelegatePepper;
class WebPluginDelegateProxy;
+class WebUIBindings;
struct ContextMenuMediaParams;
struct PP_Flash_NetAddress;
struct ThumbnailScore;