diff options
37 files changed, 506 insertions, 679 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index be193db..7af01a2 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -32,7 +32,6 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "chrome/common/view_types.h" #include "content/browser/browsing_instance.h" @@ -46,6 +45,7 @@ #include "content/browser/webui/web_ui_factory.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/keycodes/keyboard_codes.h" diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 7b2adea..c608150 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -14,7 +14,6 @@ #include "chrome/browser/renderer_preferences_util.h" #include "chrome/common/bindings_policy.h" #include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" @@ -22,6 +21,7 @@ #include "content/common/notification_source.h" #include "content/common/notification_type.h" #include "content/common/renderer_preferences.h" +#include "content/common/view_messages.h" #include "webkit/glue/webpreferences.h" BalloonHost::BalloonHost(Balloon* balloon) diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 0c93f3b..1ec08bd 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -34,6 +34,7 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_widget_host.h" #include "content/common/native_web_keyboard_event.h" +#include "content/common/view_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/x/x11_util.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 fe4e952..a63de41 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -36,6 +36,7 @@ #include "content/common/gpu_messages.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/plugin_messages.h" +#include "content/common/view_messages.h" #include "skia/ext/platform_canvas.h" #import "third_party/mozilla/ComplexTextInputPanel.h" #include "third_party/skia/include/core/SkColor.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 4620a49..972a04c 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -30,6 +30,7 @@ #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/plugin_messages.h" +#include "content/common/view_messages.h" #include "grit/webkit_resources.h" #include "skia/ext/skia_utils_win.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 9c9d09c..cc26c77 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -12,7 +12,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "chrome/test/testing_pref_service.h" #include "chrome/test/testing_profile.h" @@ -26,6 +25,7 @@ #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/test_tab_contents.h" +#include "content/common/view_messages.h" #include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/message_box_flags.h" diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index b173da2..84b38e3 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -456,7 +456,6 @@ '../skia/config/win', ], 'defines': [ - 'EXCLUDE_SKIA_DEPENDENCIES', '<@(nacl_win64_defines)', ], 'sources': [ diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index d9a07fc..a20d987 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -14,93 +14,10 @@ #include "printing/backend/print_backend.h" #include "printing/native_metafile.h" #include "printing/page_range.h" - -#ifndef EXCLUDE_SKIA_DEPENDENCIES -#include "third_party/skia/include/core/SkBitmap.h" -#endif #include "webkit/glue/password_form.h" namespace IPC { -#ifndef EXCLUDE_SKIA_DEPENDENCIES - -namespace { - -struct SkBitmap_Data { - // The configuration for the bitmap (bits per pixel, etc). - SkBitmap::Config fConfig; - - // The width of the bitmap in pixels. - uint32 fWidth; - - // The height of the bitmap in pixels. - uint32 fHeight; - - void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) { - fConfig = bitmap.config(); - fWidth = bitmap.width(); - fHeight = bitmap.height(); - } - - // Returns whether |bitmap| successfully initialized. - bool InitSkBitmapFromData(SkBitmap* bitmap, const char* pixels, - size_t total_pixels) const { - if (total_pixels) { - bitmap->setConfig(fConfig, fWidth, fHeight, 0); - if (!bitmap->allocPixels()) - return false; - if (total_pixels != bitmap->getSize()) - return false; - memcpy(bitmap->getPixels(), pixels, total_pixels); - } - return true; - } -}; - -} // namespace - - -void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) { - size_t fixed_size = sizeof(SkBitmap_Data); - SkBitmap_Data bmp_data; - bmp_data.InitSkBitmapDataForTransfer(p); - m->WriteData(reinterpret_cast<const char*>(&bmp_data), - static_cast<int>(fixed_size)); - size_t pixel_size = p.getSize(); - SkAutoLockPixels p_lock(p); - m->WriteData(reinterpret_cast<const char*>(p.getPixels()), - static_cast<int>(pixel_size)); -} - -bool ParamTraits<SkBitmap>::Read(const Message* m, void** iter, SkBitmap* r) { - const char* fixed_data; - int fixed_data_size = 0; - if (!m->ReadData(iter, &fixed_data, &fixed_data_size) || - (fixed_data_size <= 0)) { - NOTREACHED(); - return false; - } - if (fixed_data_size != sizeof(SkBitmap_Data)) - return false; // Message is malformed. - - const char* variable_data; - int variable_data_size = 0; - if (!m->ReadData(iter, &variable_data, &variable_data_size) || - (variable_data_size < 0)) { - NOTREACHED(); - return false; - } - const SkBitmap_Data* bmp_data = - reinterpret_cast<const SkBitmap_Data*>(fixed_data); - return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); -} - -void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { - l->append("<SkBitmap>"); -} - -#endif // EXCLUDE_SKIA_DEPENDENCIES - void ParamTraits<ContentSetting>::Write(Message* m, const param_type& p) { WriteParam(m, static_cast<int>(p)); } diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 1225ee1..73207ec 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -28,7 +28,6 @@ #include "webkit/glue/window_open_disposition.h" // Forward declarations. -class SkBitmap; class DictionaryValue; class ListValue; struct ThumbnailScore; @@ -46,18 +45,6 @@ struct PasswordForm; namespace IPC { template <> -struct ParamTraits<SkBitmap> { - typedef SkBitmap param_type; - static void Write(Message* m, const param_type& p); - - // Note: This function expects parameter |r| to be of type &SkBitmap since - // r->SetConfig() and r->SetPixels() are called. - static bool Read(const Message* m, void** iter, param_type* r); - - static void Log(const param_type& p, std::string* l); -}; - -template <> struct ParamTraits<ContentSetting> { typedef ContentSetting param_type; static void Write(Message* m, const param_type& p); diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc index fee4b54..d63b7cf 100644 --- a/chrome/common/extensions/extension_unpacker.cc +++ b/chrome/common/extensions/extension_unpacker.cc @@ -14,7 +14,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "net/base/file_stream.h" -#include "chrome/common/common_param_traits.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_file_util.h" @@ -22,6 +21,7 @@ #include "chrome/common/json_value_serializer.h" #include "chrome/common/url_constants.h" #include "chrome/common/zip.h" +#include "content/common/common_param_traits.h" #include "ipc/ipc_message_utils.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/image_decoder.h" diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index 3b7408e..bf77ae0 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -159,38 +159,6 @@ void ParamTraits<webkit::npapi::WebPluginInfo>::Log(const param_type& p, l->append(")"); } -void ParamTraits<WebDropData>::Write(Message* m, const param_type& p) { - WriteParam(m, p.url); - WriteParam(m, p.url_title); - WriteParam(m, p.download_metadata); - WriteParam(m, p.file_extension); - WriteParam(m, p.filenames); - WriteParam(m, p.plain_text); - WriteParam(m, p.text_html); - WriteParam(m, p.html_base_url); - WriteParam(m, p.file_description_filename); - WriteParam(m, p.file_contents); -} - -bool ParamTraits<WebDropData>::Read(const Message* m, void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->url_title) && - ReadParam(m, iter, &p->download_metadata) && - ReadParam(m, iter, &p->file_extension) && - ReadParam(m, iter, &p->filenames) && - ReadParam(m, iter, &p->plain_text) && - ReadParam(m, iter, &p->text_html) && - ReadParam(m, iter, &p->html_base_url) && - ReadParam(m, iter, &p->file_description_filename) && - ReadParam(m, iter, &p->file_contents); -} - -void ParamTraits<WebDropData>::Log(const param_type& p, std::string* l) { - l->append("<WebDropData>"); -} - void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) { WriteParam(m, p.valid_schemes()); WriteParam(m, p.GetAsString()); diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index c8d4c2d..d552ad4 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -53,7 +53,6 @@ #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcookie.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/webdropdata.h" #include "webkit/plugins/npapi/webplugin.h" #include "webkit/plugins/npapi/webplugininfo.h" @@ -136,15 +135,6 @@ struct ParamTraits<webkit::npapi::WebPluginInfo> { static void Log(const param_type& p, std::string* l); }; -// Traits for WebDropData -template <> -struct ParamTraits<WebDropData> { - typedef WebDropData 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); -}; - #if defined(OS_POSIX) // TODO(port): this shouldn't exist. However, the plugin stuff is really using @@ -322,88 +312,6 @@ IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, GURL /* url */, ContentSettings /* content_settings */) -// Change encoding of page in the renderer. -IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding, - std::string /*new encoding name*/) - -// Reset encoding of page in the renderer back to default. -IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault) - -// Requests the renderer to reserve a range of page ids. -IPC_MESSAGE_ROUTED1(ViewMsg_ReservePageIDRange, - int /* size_of_range */) - -// D&d drop target messages. -IPC_MESSAGE_ROUTED4(ViewMsg_DragTargetDragEnter, - WebDropData /* drop_data */, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - WebKit::WebDragOperationsMask /* ops_allowed */) -IPC_MESSAGE_ROUTED3(ViewMsg_DragTargetDragOver, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - WebKit::WebDragOperationsMask /* ops_allowed */) -IPC_MESSAGE_ROUTED0(ViewMsg_DragTargetDragLeave) -IPC_MESSAGE_ROUTED2(ViewMsg_DragTargetDrop, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */) - -// Notifies the renderer of updates in mouse position of an in-progress -// drag. if |ended| is true, then the user has ended the drag operation. -IPC_MESSAGE_ROUTED4(ViewMsg_DragSourceEndedOrMoved, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - bool /* ended */, - WebKit::WebDragOperation /* drag_operation */) - -// Notifies the renderer that the system DoDragDrop call has ended. -IPC_MESSAGE_ROUTED0(ViewMsg_DragSourceSystemDragEnded) - -// Used to tell a render view whether it should expose various bindings -// that allow JS content extended privileges. See BindingsPolicy for valid -// flag values. -IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings, - int /* enabled_bindings_flags */) - -// Tell the renderer to add a property to the WebUI binding object. This -// only works if we allowed WebUI bindings. -IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty, - std::string /* property_name */, - std::string /* property_value_json */) - -// This message starts/stop monitoring the input method status of the focused -// edit control of a renderer process. -// Parameters -// * is_active (bool) -// Indicates if an input method is active in the browser process. -// The possible actions when a renderer process receives this message are -// listed below: -// Value Action -// true Start sending IPC message ViewHostMsg_ImeUpdateTextInputState -// to notify the input method status of the focused edit control. -// false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState. -IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive, - bool /* is_active */) - -// This message sends a string being composed with an input method. -IPC_MESSAGE_ROUTED4( - ViewMsg_ImeSetComposition, - string16, /* text */ - std::vector<WebKit::WebCompositionUnderline>, /* underlines */ - int, /* selectiont_start */ - int /* selection_end */) - -// This message confirms an ongoing composition. -IPC_MESSAGE_ROUTED1(ViewMsg_ImeConfirmComposition, - string16 /* text */) - -// Used to notify the render-view that we have received a target URL. Used -// to prevent target URLs spamming the browser. -IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK) - -// Sets the alternate error page URL (link doctor) for the renderer process. -IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL, GURL) - // Install the first missing pluign. IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin) @@ -418,9 +326,6 @@ IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) // Tells the render view a prerendered page is about to be displayed. IPC_MESSAGE_ROUTED0(ViewMsg_DisplayPrerenderedPage) -IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse, - std::vector<FilePath> /* selected files */) - // Used to instruct the RenderView to go into "view source" mode. IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) @@ -449,24 +354,6 @@ IPC_MESSAGE_ROUTED3(ViewMsg_DownloadFavicon, a preferred image size to request, such as when downloading the favicon */) -// When a renderer sends a ViewHostMsg_Focus to the browser process, -// the browser has the option of sending a ViewMsg_CantFocus back to -// the renderer. -IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus) - -// Instructs the renderer to invoke the frame's shouldClose method, which -// runs the onbeforeunload event handler. Expects the result to be returned -// via ViewHostMsg_ShouldClose. -IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose) - -// Instructs the renderer to close the current page, including running the -// onunload event handler. See the struct in render_messages.h for more. -// -// Expects a ClosePage_ACK message when finished, where the parameters are -// echoed back. -IPC_MESSAGE_ROUTED1(ViewMsg_ClosePage, - ViewMsg_ClosePage_Params) - // Asks the renderer to send back stats on the WebCore cache broken down by // resource types. IPC_MESSAGE_CONTROL0(ViewMsg_GetCacheResourceStats) @@ -483,14 +370,6 @@ IPC_MESSAGE_CONTROL0(ViewMsg_GetRendererTcmalloc) // Asks the renderer to send back V8 heap stats. IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) -// Notifies the renderer about ui theme changes -IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged) - -// Notifies the renderer that a paint is to be generated for the rectangle -// passed in. -IPC_MESSAGE_ROUTED1(ViewMsg_Repaint, - gfx::Size /* The view size to be repainted */) - // Posts a message to the renderer. IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, std::string /* The message */, @@ -509,10 +388,6 @@ IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, bool /* script_can_close */) -// Notification that a move or resize renderer's containing window has -// started. -IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted) - // The browser sends this message in response to all extension api calls. IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionResponse, int /* request_id */, @@ -570,28 +445,6 @@ IPC_MESSAGE_CONTROL1(ViewMsg_ExtensionUnloaded, std::string) IPC_MESSAGE_CONTROL1(ViewMsg_Extension_SetScriptingWhitelist, Extension::ScriptingWhitelist /* extenison ids */) -// Changes the text direction of the currently selected input field (if any). -IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection, - WebKit::WebTextDirection /* direction */) - -// Tells the renderer to clear the focused node (if any). -IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode) - -// Make the RenderView transparent and render it onto a custom background. The -// background will be tiled in both directions if it is not large enough. -IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground, - SkBitmap /* background */) - -// Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and -// ViewHostMsg_ShowWidget to inform the renderer that the browser has -// processed the move. The browser may have ignored the move, but it finished -// processing. This is used because the renderer keeps a temporary cache of -// the widget position while these asynchronous operations are in progress. -IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK) - -// Used to instruct the RenderView to send back updates to the preferred size. -IPC_MESSAGE_ROUTED1(ViewMsg_EnablePreferredSizeChangedMode, int /*flags*/) - IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, string16 /* value */, bool /* verbatim */, @@ -609,36 +462,6 @@ IPC_MESSAGE_ROUTED4(ViewMsg_DetermineIfPageSupportsInstant, int /* selection_start */, int /* selection_end */) -// Used to tell the renderer not to add scrollbars with height and -// width below a threshold. -IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows, - gfx::Size /* disable_scrollbar_size_limit */) - -// Activate/deactivate the RenderView (i.e., set its controls' tint -// accordingly, etc.). -IPC_MESSAGE_ROUTED1(ViewMsg_SetActive, - bool /* active */) - -#if defined(OS_MACOSX) -// Let the RenderView know its window has changed visibility. -IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility, - bool /* visibile */) - -// Let the RenderView know its window's frame has changed. -IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged, - gfx::Rect /* window frame */, - gfx::Rect /* content view frame */) - -// Tell the renderer that plugin IME has completed. -IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted, - string16 /* text */, - int /* plugin_id */) -#endif - -// Response message to ViewHostMsg_CreateShared/DedicatedWorker. -// Sent when the worker has started. -IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated) - // Tell the renderer which browser window it's being attached to. IPC_MESSAGE_ROUTED1(ViewMsg_UpdateBrowserWindowId, int /* id of browser window */) @@ -719,12 +542,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_AccessibilityDoDefaultAction, // message was processed and it can send addition notifications. IPC_MESSAGE_ROUTED0(ViewMsg_AccessibilityNotifications_ACK) -// The response to ViewHostMsg_AsyncOpenFile. -IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, - base::PlatformFileError /* error_code */, - IPC::PlatformFileForTransit /* file descriptor */, - int /* message_id */) - // A classification model for client-side phishing detection. // The given file contains an encoded safe_browsing::ClientSideModel // protocol buffer. @@ -738,11 +555,6 @@ IPC_MESSAGE_ROUTED0(ViewMsg_GetMalwareDOMDetails) // which it has started loading. IPC_MESSAGE_ROUTED1(ViewMsg_StartPhishingDetection, GURL) -// 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, - bool /* online */) - //----------------------------------------------------------------------------- // TabContents messages // These are messages sent from the renderer to the browser process. @@ -1231,21 +1043,6 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionChanged, IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser, ViewHostMsg_RunFileChooser_Params) -// Used to tell the parent the user started dragging in the content area. The -// WebDropData struct contains contextual information about the pieces of the -// page the user dragged. The parent uses this notification to initiate a -// drag session at the OS level. -IPC_MESSAGE_ROUTED4(ViewHostMsg_StartDragging, - WebDropData /* drop_data */, - WebKit::WebDragOperationsMask /* ops_allowed */, - SkBitmap /* image */, - gfx::Point /* image_offset */) - -// The page wants to update the mouse cursor during a drag & drop operation. -// |is_drop_target| is true if the mouse is over a valid drop target. -IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateDragCursor, - WebKit::WebDragOperation /* drag_operation */) - // Tells the browser to move the focus to the next (previous if reverse is // true) focusable element. IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus, bool /* reverse */) @@ -1415,18 +1212,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_DidGetApplicationInfo, IPC_MESSAGE_ROUTED1(ViewHostMsg_InstallApplication, WebApplicationInfo) -// Provides the result from running OnMsgShouldClose. |proceed| matches the -// return value of the the frame's shouldClose method (which includes the -// onbeforeunload handler): true if the user decided to proceed with leaving -// the page. -IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK, - bool /* proceed */) - -// Indicates that the current page has been closed, after a ClosePage -// message. The parameters are just echoed from the ClosePage request. -IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK, - ViewMsg_ClosePage_Params) - IPC_MESSAGE_ROUTED4(ViewHostMsg_DidDownloadFavicon, int /* Identifier of the request */, GURL /* URL of the image */, @@ -1609,47 +1394,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, uint64 /* surface_id */) #endif -// A renderer sends this to the browser process when it wants to create a -// worker. The browser will create the worker process if necessary, and -// will return the route id on success. On error returns MSG_ROUTING_NONE. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker, - ViewHostMsg_CreateWorker_Params, - int /* route_id */) - -// This message is sent to the browser to see if an instance of this shared -// worker already exists. If so, it returns exists == true. If a -// non-empty name is passed, also validates that the url matches the url of -// the existing worker. If a matching worker is found, the passed-in -// document_id is associated with that worker, to ensure that the worker -// stays alive until the document is detached. -// The route_id returned can be used to forward messages to the worker via -// ForwardToWorker if it exists, otherwise it should be passed in to any -// future call to CreateWorker to avoid creating duplicate workers. -IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker, - ViewHostMsg_CreateWorker_Params, - bool /* exists */, - int /* route_id */, - bool /* url_mismatch */) - -// A renderer sends this to the browser process when a document has been -// detached. The browser will use this to constrain the lifecycle of worker -// processes (SharedWorkers are shut down when their last associated document -// is detached). -IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached, - uint64 /* document_id */) - -// Sent if the worker object has sent a ViewHostMsg_CreateDedicatedWorker -// message and not received a ViewMsg_WorkerCreated reply, but in the -// mean time it's destroyed. This tells the browser to not create the queued -// worker. -IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker, - int /* route_id */) - -// Wraps an IPC message that's destined to the worker on the renderer->browser -// hop. -IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker, - IPC::Message /* message */) - // Open a channel to all listening contexts owned by the extension with // the given ID. This always returns a valid port ID which can be used for // sending messages. If an error occurred, the opener will be notified diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 84c00c9..4a60180 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -35,17 +35,6 @@ ViewHostMsg_UpdateRect_Params::ViewHostMsg_UpdateRect_Params() ViewHostMsg_UpdateRect_Params::~ViewHostMsg_UpdateRect_Params() { } -ViewMsg_ClosePage_Params::ViewMsg_ClosePage_Params() - : closing_process_id(0), - closing_route_id(0), - for_cross_site_transition(false), - new_render_process_host_id(0), - new_request_id(0) { -} - -ViewMsg_ClosePage_Params::~ViewMsg_ClosePage_Params() { -} - ViewMsg_Print_Params::ViewMsg_Print_Params() : margin_top(0), margin_left(0), @@ -158,18 +147,6 @@ ViewMsg_ExecuteCode_Params::ViewMsg_ExecuteCode_Params( ViewMsg_ExecuteCode_Params::~ViewMsg_ExecuteCode_Params() { } -ViewHostMsg_CreateWorker_Params::ViewHostMsg_CreateWorker_Params() - : is_shared(false), - document_id(0), - render_view_route_id(0), - route_id(0), - parent_appcache_host_id(0), - script_resource_appcache_id(0) { -} - -ViewHostMsg_CreateWorker_Params::~ViewHostMsg_CreateWorker_Params() { -} - ViewHostMsg_CreateWindow_Params::ViewHostMsg_CreateWindow_Params() : opener_id(0), user_gesture(false), @@ -588,40 +565,6 @@ void ParamTraits<ViewHostMsg_UpdateRect_Params>::Log(const param_type& p, l->append(")"); } -void ParamTraits<ViewMsg_ClosePage_Params>::Write(Message* m, - const param_type& p) { - WriteParam(m, p.closing_process_id); - WriteParam(m, p.closing_route_id); - WriteParam(m, p.for_cross_site_transition); - WriteParam(m, p.new_render_process_host_id); - WriteParam(m, p.new_request_id); -} - -bool ParamTraits<ViewMsg_ClosePage_Params>::Read(const Message* m, - void** iter, - param_type* r) { - return ReadParam(m, iter, &r->closing_process_id) && - ReadParam(m, iter, &r->closing_route_id) && - ReadParam(m, iter, &r->for_cross_site_transition) && - ReadParam(m, iter, &r->new_render_process_host_id) && - ReadParam(m, iter, &r->new_request_id); -} - -void ParamTraits<ViewMsg_ClosePage_Params>::Log(const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.closing_process_id, l); - l->append(", "); - LogParam(p.closing_route_id, l); - l->append(", "); - LogParam(p.for_cross_site_transition, l); - l->append(", "); - LogParam(p.new_render_process_host_id, l); - l->append(", "); - LogParam(p.new_request_id, l); - l->append(")"); -} - void ParamTraits<ViewMsg_Print_Params>::Write(Message* m, const param_type& p) { WriteParam(m, p.page_size); WriteParam(m, p.printable_size); @@ -809,53 +752,6 @@ void ParamTraits<ViewMsg_ExecuteCode_Params>::Log(const param_type& p, l->append("<ViewMsg_ExecuteCode_Params>"); } -void ParamTraits<ViewHostMsg_CreateWorker_Params>::Write(Message* m, - const param_type& p) { - WriteParam(m, p.url); - WriteParam(m, p.is_shared); - WriteParam(m, p.name); - WriteParam(m, p.document_id); - WriteParam(m, p.render_view_route_id); - WriteParam(m, p.route_id); - WriteParam(m, p.parent_appcache_host_id); - WriteParam(m, p.script_resource_appcache_id); -} - -bool ParamTraits<ViewHostMsg_CreateWorker_Params>::Read(const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->is_shared) && - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->document_id) && - ReadParam(m, iter, &p->render_view_route_id) && - ReadParam(m, iter, &p->route_id) && - ReadParam(m, iter, &p->parent_appcache_host_id) && - ReadParam(m, iter, &p->script_resource_appcache_id); -} - -void ParamTraits<ViewHostMsg_CreateWorker_Params>::Log(const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.url, l); - l->append(", "); - LogParam(p.is_shared, l); - l->append(", "); - LogParam(p.name, l); - l->append(", "); - LogParam(p.document_id, l); - l->append(", "); - LogParam(p.render_view_route_id, l); - l->append(","); - LogParam(p.route_id, l); - l->append(", "); - LogParam(p.parent_appcache_host_id, l); - l->append(","); - LogParam(p.script_resource_appcache_id, 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 149d59e..4ce3b86 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -276,45 +276,6 @@ struct ViewHostMsg_UpdateRect_Params { int flags; }; -// Information on closing a tab. This is used both for ViewMsg_ClosePage, and -// the corresponding ViewHostMsg_ClosePage_ACK. -struct ViewMsg_ClosePage_Params { - ViewMsg_ClosePage_Params(); - ~ViewMsg_ClosePage_Params(); - - // The identifier of the RenderProcessHost for the currently closing view. - // - // These first two parameters are technically redundant since they are - // needed only when processing the ACK message, and the processor - // theoretically knows both the process and route ID. However, this is - // difficult to figure out with our current implementation, so this - // information is duplicate here. - int closing_process_id; - - // The route identifier for the currently closing RenderView. - int closing_route_id; - - // True when this close is for the first (closing) tab of a cross-site - // transition where we switch processes. False indicates the close is for the - // entire tab. - // - // When true, the new_* variables below must be filled in. Otherwise they must - // both be -1. - bool for_cross_site_transition; - - // The identifier of the RenderProcessHost for the new view attempting to - // replace the closing one above. This must be valid when - // for_cross_site_transition is set, and must be -1 otherwise. - int new_render_process_host_id; - - // The identifier of the *request* the new view made that is causing the - // cross-site transition. This is *not* a route_id, but the request that we - // will resume once the ACK from the closing view has been received. This - // must be valid when for_cross_site_transition is set, and must be -1 - // otherwise. - int new_request_id; -}; - // Parameters for a render request. struct ViewMsg_Print_Params { ViewMsg_Print_Params(); @@ -473,38 +434,6 @@ struct ViewMsg_ExecuteCode_Params { bool all_frames; }; -// Parameters for the message that creates a worker thread. -struct ViewHostMsg_CreateWorker_Params { - ViewHostMsg_CreateWorker_Params(); - ~ViewHostMsg_CreateWorker_Params(); - - // URL for the worker script. - GURL url; - - // True if this is a SharedWorker, false if it is a dedicated Worker. - bool is_shared; - - // Name for a SharedWorker, otherwise empty string. - string16 name; - - // The ID of the parent document (unique within parent renderer). - unsigned long long document_id; - - // RenderView routing id used to send messages back to the parent. - int render_view_route_id; - - // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed, - // a new unique ID is created and assigned to the worker. - int route_id; - - // The ID of the parent's appcache host, only valid for dedicated workers. - int parent_appcache_host_id; - - // The ID of the appcache the main shared worker script resource was loaded - // from, only valid for shared workers. - int64 script_resource_appcache_id; -}; - struct ViewHostMsg_CreateWindow_Params { ViewHostMsg_CreateWindow_Params(); ~ViewHostMsg_CreateWindow_Params(); @@ -718,14 +647,6 @@ struct ParamTraits<ViewHostMsg_UpdateRect_Params> { }; template <> -struct ParamTraits<ViewMsg_ClosePage_Params> { - typedef ViewMsg_ClosePage_Params 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 ParamTraits<ViewMsg_Print_Params> { typedef ViewMsg_Print_Params param_type; static void Write(Message* m, const param_type& p); @@ -781,14 +702,6 @@ struct ParamTraits<ViewMsg_ExecuteCode_Params> { static void Log(const param_type& p, std::string* l); }; -template <> -struct ParamTraits<ViewHostMsg_CreateWorker_Params> { - typedef ViewHostMsg_CreateWorker_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; diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc index 5a48c12..5c9bd48 100644 --- a/chrome/common/webkit_param_traits.cc +++ b/chrome/common/webkit_param_traits.cc @@ -5,7 +5,6 @@ #include "chrome/common/webkit_param_traits.h" #include "base/format_macros.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" namespace IPC { @@ -78,37 +77,6 @@ void ParamTraits<WebKit::WebCache::ResourceTypeStat>::Log( p.count, p.size, p.liveSize, p.decodedSize)); } -void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m, - const param_type& p) { - WriteParam(m, p.startOffset); - WriteParam(m, p.endOffset); - WriteParam(m, p.color); - WriteParam(m, p.thick); -} - -bool ParamTraits<WebKit::WebCompositionUnderline>::Read( - const Message* m, void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->startOffset) && - ReadParam(m, iter, &p->endOffset) && - ReadParam(m, iter, &p->color) && - ReadParam(m, iter, &p->thick); -} - -void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.startOffset, l); - l->append(","); - LogParam(p.endOffset, l); - l->append(":"); - LogParam(p.color, l); - l->append(":"); - LogParam(p.thick, l); - l->append(")"); -} - void ParamTraits<WebKit::WebTextCheckingResult>::Write(Message* m, const param_type& p) { #if defined(WEB_TEXT_CHECKING_RESULT_IS_A_STRUCT) diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h index 2a9609d..9e7aa48 100644 --- a/chrome/common/webkit_param_traits.h +++ b/chrome/common/webkit_param_traits.h @@ -28,14 +28,12 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h" namespace WebKit { -struct WebCompositionUnderline; struct WebRect; struct WebScreenInfo; } @@ -142,19 +140,6 @@ struct ParamTraits<WebKit::WebCache::ResourceTypeStats> { }; template <> -struct SimilarTypeTraits<WebKit::WebDragOperation> { - typedef int Type; -}; - -template <> -struct ParamTraits<WebKit::WebCompositionUnderline> { - typedef WebKit::WebCompositionUnderline 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::WebTextInputType> { typedef WebKit::WebTextInputType param_type; static void Write(Message* m, const param_type& p) { diff --git a/chrome/tools/ipclist/all_messages.h b/chrome/tools/ipclist/all_messages.h index af80dd9..72fdab7 100644 --- a/chrome/tools/ipclist/all_messages.h +++ b/chrome/tools/ipclist/all_messages.h @@ -22,6 +22,7 @@ #include "content/common/desktop_notification_messages.h" #include "content/common/device_orientation_messages.h" #include "content/common/dom_storage_messages.h" +#include "content/common/drag_messages.h" #include "content/common/file_system_messages.h" #include "content/common/file_utilities_messages.h" #include "content/common/geolocation_messages.h" diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 198f319..d5c4747 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -39,6 +39,7 @@ #include "content/browser/renderer_host/render_widget_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/site_instance.h" +#include "content/common/drag_messages.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" @@ -451,24 +452,24 @@ void RenderViewHost::DragTargetDragEnter( net::FilePathToFileURL(path)); policy->GrantReadFile(process()->id(), path); } - Send(new ViewMsg_DragTargetDragEnter(routing_id(), drop_data, client_pt, - screen_pt, operations_allowed)); + Send(new DragMsg_TargetDragEnter(routing_id(), drop_data, client_pt, + screen_pt, operations_allowed)); } void RenderViewHost::DragTargetDragOver( const gfx::Point& client_pt, const gfx::Point& screen_pt, WebDragOperationsMask operations_allowed) { - Send(new ViewMsg_DragTargetDragOver(routing_id(), client_pt, screen_pt, - operations_allowed)); + Send(new DragMsg_TargetDragOver(routing_id(), client_pt, screen_pt, + operations_allowed)); } void RenderViewHost::DragTargetDragLeave() { - Send(new ViewMsg_DragTargetDragLeave(routing_id())); + Send(new DragMsg_TargetDragLeave(routing_id())); } void RenderViewHost::DragTargetDrop( const gfx::Point& client_pt, const gfx::Point& screen_pt) { - Send(new ViewMsg_DragTargetDrop(routing_id(), client_pt, screen_pt)); + Send(new DragMsg_TargetDrop(routing_id(), client_pt, screen_pt)); } void RenderViewHost::ReservePageIDRange(int size) { @@ -590,7 +591,7 @@ void RenderViewHost::CopyImageAt(int x, int y) { void RenderViewHost::DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y, WebDragOperation operation) { - Send(new ViewMsg_DragSourceEndedOrMoved( + Send(new DragMsg_SourceEndedOrMoved( routing_id(), gfx::Point(client_x, client_y), gfx::Point(screen_x, screen_y), @@ -599,7 +600,7 @@ void RenderViewHost::DragSourceEndedAt( void RenderViewHost::DragSourceMovedTo( int client_x, int client_y, int screen_x, int screen_y) { - Send(new ViewMsg_DragSourceEndedOrMoved( + Send(new DragMsg_SourceEndedOrMoved( routing_id(), gfx::Point(client_x, client_y), gfx::Point(screen_x, screen_y), @@ -607,7 +608,7 @@ void RenderViewHost::DragSourceMovedTo( } void RenderViewHost::DragSourceSystemDragEnded() { - Send(new ViewMsg_DragSourceSystemDragEnded(routing_id())); + Send(new DragMsg_SourceSystemDragEnded(routing_id())); } void RenderViewHost::AllowBindings(int bindings_flags) { @@ -756,8 +757,8 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) { OnMsgRunJavaScriptMessage) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, OnMsgRunBeforeUnloadConfirm) - IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging) - IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor) + IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) + IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsAgent, diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc index 4c474c7..421af33 100644 --- a/content/browser/renderer_host/render_widget_helper.cc +++ b/content/browser/renderer_host/render_widget_helper.cc @@ -11,6 +11,7 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" +#include "content/common/view_messages.h" // A Task used with InvokeLater that we hold a pointer to in pending_paints_. // Instances are deleted by MessageLoop after it calls their Run method. diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index 936d1d0..35875c5 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -37,8 +37,6 @@ #include "chrome/browser/ssl/ssl_manager.h" #include "chrome/browser/ui/login/login_prompt.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "content/browser/cert_store.h" #include "content/browser/child_process_security_policy.h" @@ -62,6 +60,7 @@ #include "content/browser/worker_host/worker_service.h" #include "content/common/notification_service.h" #include "content/common/resource_messages.h" +#include "content/common/view_messages.h" #include "net/base/auth.h" #include "net/base/cert_status_flags.h" #include "net/base/cookie_monster.h" diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 501a119..ee56978 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -9,7 +9,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/render_view_host.h" @@ -24,6 +23,7 @@ #include "content/browser/webui/web_ui_factory.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" +#include "content/common/view_messages.h" namespace base { class WaitableEvent; diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc index 728705f..3ff2092 100644 --- a/content/browser/tab_contents/render_view_host_manager_unittest.cc +++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc @@ -4,7 +4,6 @@ #include "chrome/browser/browser_url_handler.h" #include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" #include "chrome/test/test_notification_tracker.h" #include "chrome/test/testing_profile.h" @@ -18,6 +17,7 @@ #include "content/common/notification_details.h" #include "content/common/notification_source.h" #include "content/common/page_transition_types.h" +#include "content/common/view_messages.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/webkit_glue.h" diff --git a/content/browser/worker_host/worker_message_filter.cc b/content/browser/worker_host/worker_message_filter.cc index c46b131..7edb8de 100644 --- a/content/browser/worker_host/worker_message_filter.cc +++ b/content/browser/worker_host/worker_message_filter.cc @@ -6,10 +6,9 @@ #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/common/net/url_request_context_getter.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "content/browser/worker_host/message_port_service.h" #include "content/browser/worker_host/worker_service.h" +#include "content/common/view_messages.h" #include "content/common/worker_messages.h" WorkerMessageFilter::WorkerMessageFilter( diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index bc29bca..7199594 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -16,8 +16,6 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "content/browser/appcache/appcache_dispatcher_host.h" #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" @@ -35,6 +33,7 @@ #include "content/browser/worker_host/worker_service.h" #include "content/common/debug_flags.h" #include "content/common/result_codes.h" +#include "content/common/view_messages.h" #include "content/common/worker_messages.h" #include "net/base/mime_util.h" #include "ipc/ipc_switches.h" diff --git a/content/browser/worker_host/worker_service.cc b/content/browser/worker_host/worker_service.cc index b43395a..e7a2cf6 100644 --- a/content/browser/worker_host/worker_service.cc +++ b/content/browser/worker_host/worker_service.cc @@ -10,10 +10,9 @@ #include "base/sys_info.h" #include "base/threading/thread.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "content/browser/worker_host/worker_message_filter.h" #include "content/browser/worker_host/worker_process_host.h" +#include "content/common/view_messages.h" #include "content/common/worker_messages.h" #include "net/base/registry_controlled_domain.h" diff --git a/content/common/common_param_traits.cc b/content/common/common_param_traits.cc index 21c4801..df7bfde 100644 --- a/content/common/common_param_traits.cc +++ b/content/common/common_param_traits.cc @@ -9,9 +9,45 @@ #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/rect.h" #include "webkit/glue/resource_loader_bridge.h" +namespace { + +struct SkBitmap_Data { + // The configuration for the bitmap (bits per pixel, etc). + SkBitmap::Config fConfig; + + // The width of the bitmap in pixels. + uint32 fWidth; + + // The height of the bitmap in pixels. + uint32 fHeight; + + void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) { + fConfig = bitmap.config(); + fWidth = bitmap.width(); + fHeight = bitmap.height(); + } + + // Returns whether |bitmap| successfully initialized. + bool InitSkBitmapFromData(SkBitmap* bitmap, const char* pixels, + size_t total_pixels) const { + if (total_pixels) { + bitmap->setConfig(fConfig, fWidth, fHeight, 0); + if (!bitmap->allocPixels()) + return false; + if (total_pixels != bitmap->getSize()) + return false; + memcpy(bitmap->getPixels(), pixels, total_pixels); + } + return true; + } +}; + +} // namespace + NPIdentifier_Param::NPIdentifier_Param() : identifier() { } @@ -761,4 +797,43 @@ void ParamTraits<NPIdentifier_Param>::Log(const param_type& p, std::string* l) { } } +void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) { + size_t fixed_size = sizeof(SkBitmap_Data); + SkBitmap_Data bmp_data; + bmp_data.InitSkBitmapDataForTransfer(p); + m->WriteData(reinterpret_cast<const char*>(&bmp_data), + static_cast<int>(fixed_size)); + size_t pixel_size = p.getSize(); + SkAutoLockPixels p_lock(p); + m->WriteData(reinterpret_cast<const char*>(p.getPixels()), + static_cast<int>(pixel_size)); +} + +bool ParamTraits<SkBitmap>::Read(const Message* m, void** iter, SkBitmap* r) { + const char* fixed_data; + int fixed_data_size = 0; + if (!m->ReadData(iter, &fixed_data, &fixed_data_size) || + (fixed_data_size <= 0)) { + NOTREACHED(); + return false; + } + if (fixed_data_size != sizeof(SkBitmap_Data)) + return false; // Message is malformed. + + const char* variable_data; + int variable_data_size = 0; + if (!m->ReadData(iter, &variable_data, &variable_data_size) || + (variable_data_size < 0)) { + NOTREACHED(); + return false; + } + const SkBitmap_Data* bmp_data = + reinterpret_cast<const SkBitmap_Data*>(fixed_data); + return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); +} + +void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { + l->append("<SkBitmap>"); +} + } // namespace IPC diff --git a/content/common/common_param_traits.h b/content/common/common_param_traits.h index 3f7d0b3..a2c126a 100644 --- a/content/common/common_param_traits.h +++ b/content/common/common_param_traits.h @@ -30,6 +30,8 @@ #include "webkit/glue/resource_type.h" #include "webkit/glue/webcursor.h" +class SkBitmap; + namespace gfx { class Point; class Rect; @@ -384,6 +386,19 @@ struct SimilarTypeTraits<WebKit::WebTextDirection> { typedef int Type; }; +template <> +struct ParamTraits<SkBitmap> { + typedef SkBitmap param_type; + static void Write(Message* m, const param_type& p); + + // Note: This function expects parameter |r| to be of type &SkBitmap since + // r->SetConfig() and r->SetPixels() are called. + static bool Read(const Message* m, void** iter, param_type* r); + + static void Log(const param_type& p, std::string* l); +}; + + } // namespace IPC #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h index ba925c2..b784020 100644 --- a/content/common/content_message_generator.h +++ b/content/common/content_message_generator.h @@ -12,6 +12,7 @@ #include "content/common/desktop_notification_messages.h" #include "content/common/device_orientation_messages.h" #include "content/common/dom_storage_messages.h" +#include "content/common/drag_messages.h" #include "content/common/file_system_messages.h" #include "content/common/file_utilities_messages.h" #include "content/common/geolocation_messages.h" diff --git a/content/common/drag_messages.h b/content/common/drag_messages.h new file mode 100644 index 0000000..d73470f --- /dev/null +++ b/content/common/drag_messages.h @@ -0,0 +1,76 @@ +// 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 drag and drop. +// Multiply-included message file, hence no include guard. + +#include "content/common/common_param_traits.h" +#include "ipc/ipc_message_macros.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" +#include "webkit/glue/webdropdata.h" + +#define IPC_MESSAGE_START DragMsgStart + +IPC_ENUM_TRAITS(WebKit::WebDragOperation) + +IPC_STRUCT_TRAITS_BEGIN(WebDropData) + IPC_STRUCT_TRAITS_MEMBER(url) + IPC_STRUCT_TRAITS_MEMBER(url_title) + IPC_STRUCT_TRAITS_MEMBER(download_metadata) + IPC_STRUCT_TRAITS_MEMBER(file_extension) + IPC_STRUCT_TRAITS_MEMBER(filenames) + IPC_STRUCT_TRAITS_MEMBER(plain_text) + IPC_STRUCT_TRAITS_MEMBER(text_html) + IPC_STRUCT_TRAITS_MEMBER(html_base_url) + IPC_STRUCT_TRAITS_MEMBER(file_description_filename) + IPC_STRUCT_TRAITS_MEMBER(file_contents) +IPC_STRUCT_TRAITS_END() + +// Messages sent from the browser to the renderer. + +IPC_MESSAGE_ROUTED4(DragMsg_TargetDragEnter, + WebDropData /* drop_data */, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + WebKit::WebDragOperationsMask /* ops_allowed */) + +IPC_MESSAGE_ROUTED3(DragMsg_TargetDragOver, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + WebKit::WebDragOperationsMask /* ops_allowed */) + +IPC_MESSAGE_ROUTED0(DragMsg_TargetDragLeave) + +IPC_MESSAGE_ROUTED2(DragMsg_TargetDrop, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */) + +// Notifies the renderer of updates in mouse position of an in-progress +// drag. if |ended| is true, then the user has ended the drag operation. +IPC_MESSAGE_ROUTED4(DragMsg_SourceEndedOrMoved, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + bool /* ended */, + WebKit::WebDragOperation /* drag_operation */) + +// Notifies the renderer that the system DoDragDrop call has ended. +IPC_MESSAGE_ROUTED0(DragMsg_SourceSystemDragEnded) + +// Messages sent from the renderer to the browser. + +// Used to tell the parent the user started dragging in the content area. The +// WebDropData struct contains contextual information about the pieces of the +// page the user dragged. The parent uses this notification to initiate a +// drag session at the OS level. +IPC_MESSAGE_ROUTED4(DragHostMsg_StartDragging, + WebDropData /* drop_data */, + WebKit::WebDragOperationsMask /* ops_allowed */, + SkBitmap /* image */, + gfx::Point /* image_offset */) + +// The page wants to update the mouse cursor during a drag & drop operation. +// |is_drop_target| is true if the mouse is over a valid drop target. +IPC_MESSAGE_ROUTED1(DragHostMsg_UpdateDragCursor, + WebKit::WebDragOperation /* drag_operation */) diff --git a/content/common/view_messages.h b/content/common/view_messages.h index a6c9461..d4c6229 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -12,6 +12,8 @@ #include "content/common/page_zoom.h" #include "content/common/renderer_preferences.h" #include "ipc/ipc_message_macros.h" +#include "ipc/ipc_platform_file.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 "ui/gfx/rect.h" @@ -102,6 +104,13 @@ IPC_STRUCT_TRAITS_BEGIN(ViewMsg_StopFinding_Params) IPC_STRUCT_TRAITS_MEMBER(action) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCompositionUnderline) + IPC_STRUCT_TRAITS_MEMBER(startOffset) + IPC_STRUCT_TRAITS_MEMBER(endOffset) + IPC_STRUCT_TRAITS_MEMBER(color) + IPC_STRUCT_TRAITS_MEMBER(thick) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFindOptions) IPC_STRUCT_TRAITS_MEMBER(forward) IPC_STRUCT_TRAITS_MEMBER(matchCase) @@ -217,6 +226,68 @@ IPC_STRUCT_TRAITS_BEGIN(ContextMenuParams) IPC_STRUCT_TRAITS_MEMBER(custom_items) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_BEGIN(ViewMsg_ClosePage_Params) + // The identifier of the RenderProcessHost for the currently closing view. + // + // These first two parameters are technically redundant since they are + // needed only when processing the ACK message, and the processor + // theoretically knows both the process and route ID. However, this is + // difficult to figure out with our current implementation, so this + // information is duplicate here. + IPC_STRUCT_MEMBER(int, closing_process_id) + + // The route identifier for the currently closing RenderView. + IPC_STRUCT_MEMBER(int, closing_route_id) + + // True when this close is for the first (closing) tab of a cross-site + // transition where we switch processes. False indicates the close is for the + // entire tab. + // + // When true, the new_* variables below must be filled in. Otherwise they must + // both be -1. + IPC_STRUCT_MEMBER(bool, for_cross_site_transition) + + // The identifier of the RenderProcessHost for the new view attempting to + // replace the closing one above. This must be valid when + // for_cross_site_transition is set, and must be -1 otherwise. + IPC_STRUCT_MEMBER(int, new_render_process_host_id) + + // The identifier of the *request* the new view made that is causing the + // cross-site transition. This is *not* a route_id, but the request that we + // will resume once the ACK from the closing view has been received. This + // must be valid when for_cross_site_transition is set, and must be -1 + // otherwise. + IPC_STRUCT_MEMBER(int, new_request_id) +IPC_STRUCT_END() + +IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params) + // URL for the worker script. + IPC_STRUCT_MEMBER(GURL, url) + + // True if this is a SharedWorker, false if it is a dedicated Worker. + IPC_STRUCT_MEMBER(bool, is_shared) + + // Name for a SharedWorker, otherwise empty string. + IPC_STRUCT_MEMBER(string16, name) + + // The ID of the parent document (unique within parent renderer). + IPC_STRUCT_MEMBER(unsigned long long, document_id) + + // RenderView routing id used to send messages back to the parent. + IPC_STRUCT_MEMBER(int, render_view_route_id) + + // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed, + // a new unique ID is created and assigned to the worker. + IPC_STRUCT_MEMBER(int, route_id) + + // The ID of the parent's appcache host, only valid for dedicated workers. + IPC_STRUCT_MEMBER(int, parent_appcache_host_id) + + // The ID of the appcache the main shared worker script resource was loaded + // from, only valid for shared workers. + IPC_STRUCT_MEMBER(int64, script_resource_appcache_id) +IPC_STRUCT_END() + IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params) // The page_id for this navigation, or -1 if it is a new navigation. Back, // Forward, and Reload navigations should have a valid page_id. If the load @@ -557,6 +628,160 @@ IPC_MESSAGE_CONTROL2(ViewMsg_SetZoomLevelForCurrentURL, GURL /* url */, double /* zoom_level */) +// Change encoding of page in the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding, + std::string /*new encoding name*/) + +// Reset encoding of page in the renderer back to default. +IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault) + +// Requests the renderer to reserve a range of page ids. +IPC_MESSAGE_ROUTED1(ViewMsg_ReservePageIDRange, + int /* size_of_range */) + +// Used to tell a render view whether it should expose various bindings +// that allow JS content extended privileges. See BindingsPolicy for valid +// flag values. +IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings, + int /* enabled_bindings_flags */) + +// Tell the renderer to add a property to the WebUI binding object. This +// only works if we allowed WebUI bindings. +IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty, + std::string /* property_name */, + std::string /* property_value_json */) + +// This message starts/stop monitoring the input method status of the focused +// edit control of a renderer process. +// Parameters +// * is_active (bool) +// Indicates if an input method is active in the browser process. +// The possible actions when a renderer process receives this message are +// listed below: +// Value Action +// true Start sending IPC message ViewHostMsg_ImeUpdateTextInputState +// to notify the input method status of the focused edit control. +// false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState. +IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive, + bool /* is_active */) + +// This message sends a string being composed with an input method. +IPC_MESSAGE_ROUTED4( + ViewMsg_ImeSetComposition, + string16, /* text */ + std::vector<WebKit::WebCompositionUnderline>, /* underlines */ + int, /* selectiont_start */ + int /* selection_end */) + +// This message confirms an ongoing composition. +IPC_MESSAGE_ROUTED1(ViewMsg_ImeConfirmComposition, + string16 /* text */) + +// Used to notify the render-view that we have received a target URL. Used +// to prevent target URLs spamming the browser. +IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK) + + +// Sets the alternate error page URL (link doctor) for the renderer process. +IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL, + GURL) + +IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse, + std::vector<FilePath> /* selected files */) + +// When a renderer sends a ViewHostMsg_Focus to the browser process, +// the browser has the option of sending a ViewMsg_CantFocus back to +// the renderer. +IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus) + +// Instructs the renderer to invoke the frame's shouldClose method, which +// runs the onbeforeunload event handler. Expects the result to be returned +// via ViewHostMsg_ShouldClose. +IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose) + +// Instructs the renderer to close the current page, including running the +// onunload event handler. See the struct in render_messages.h for more. +// +// Expects a ClosePage_ACK message when finished, where the parameters are +// echoed back. +IPC_MESSAGE_ROUTED1(ViewMsg_ClosePage, + ViewMsg_ClosePage_Params) + +// Notifies the renderer about ui theme changes +IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged) + +// Notifies the renderer that a paint is to be generated for the rectangle +// passed in. +IPC_MESSAGE_ROUTED1(ViewMsg_Repaint, + gfx::Size /* The view size to be repainted */) + +// Notification that a move or resize renderer's containing window has +// started. +IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted) + +// Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and +// ViewHostMsg_ShowWidget to inform the renderer that the browser has +// processed the move. The browser may have ignored the move, but it finished +// processing. This is used because the renderer keeps a temporary cache of +// the widget position while these asynchronous operations are in progress. +IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK) + +// Used to instruct the RenderView to send back updates to the preferred size. +IPC_MESSAGE_ROUTED1(ViewMsg_EnablePreferredSizeChangedMode, + int /*flags*/) + +// Changes the text direction of the currently selected input field (if any). +IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection, + WebKit::WebTextDirection /* direction */) + +// Tells the renderer to clear the focused node (if any). +IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode) + +// Make the RenderView transparent and render it onto a custom background. The +// background will be tiled in both directions if it is not large enough. +IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground, + SkBitmap /* background */) + +// Used to tell the renderer not to add scrollbars with height and +// width below a threshold. +IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows, + gfx::Size /* disable_scrollbar_size_limit */) + +// Activate/deactivate the RenderView (i.e., set its controls' tint +// accordingly, etc.). +IPC_MESSAGE_ROUTED1(ViewMsg_SetActive, + bool /* active */) + +#if defined(OS_MACOSX) +// Let the RenderView know its window has changed visibility. +IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility, + bool /* visibile */) + +// Let the RenderView know its window's frame has changed. +IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged, + gfx::Rect /* window frame */, + gfx::Rect /* content view frame */) + +// Tell the renderer that plugin IME has completed. +IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted, + string16 /* text */, + int /* plugin_id */) +#endif + +// Response message to ViewHostMsg_CreateShared/DedicatedWorker. +// Sent when the worker has started. +IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated) + +// The response to ViewHostMsg_AsyncOpenFile. +IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, + base::PlatformFileError /* error_code */, + IPC::PlatformFileForTransit /* file descriptor */, + int /* message_id */) + +// 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, + bool /* online */) // Messages sent from the renderer to the browser. @@ -591,3 +816,57 @@ IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply, gfx::Rect /* selection_rect */, int /* active_match_ordinal */, bool /* final_update */) + +// Provides the result from running OnMsgShouldClose. |proceed| matches the +// return value of the the frame's shouldClose method (which includes the +// onbeforeunload handler): true if the user decided to proceed with leaving +// the page. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK, + bool /* proceed */) + +// Indicates that the current page has been closed, after a ClosePage +// message. The parameters are just echoed from the ClosePage request. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK, + ViewMsg_ClosePage_Params) + + +// A renderer sends this to the browser process when it wants to create a +// worker. The browser will create the worker process if necessary, and +// will return the route id on success. On error returns MSG_ROUTING_NONE. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker, + ViewHostMsg_CreateWorker_Params, + int /* route_id */) + +// This message is sent to the browser to see if an instance of this shared +// worker already exists. If so, it returns exists == true. If a +// non-empty name is passed, also validates that the url matches the url of +// the existing worker. If a matching worker is found, the passed-in +// document_id is associated with that worker, to ensure that the worker +// stays alive until the document is detached. +// The route_id returned can be used to forward messages to the worker via +// ForwardToWorker if it exists, otherwise it should be passed in to any +// future call to CreateWorker to avoid creating duplicate workers. +IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker, + ViewHostMsg_CreateWorker_Params, + bool /* exists */, + int /* route_id */, + bool /* url_mismatch */) + +// A renderer sends this to the browser process when a document has been +// detached. The browser will use this to constrain the lifecycle of worker +// processes (SharedWorkers are shut down when their last associated document +// is detached). +IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached, + uint64 /* document_id */) + +// Wraps an IPC message that's destined to the worker on the renderer->browser +// hop. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker, + IPC::Message /* message */) + +// Sent if the worker object has sent a ViewHostMsg_CreateDedicatedWorker +// message and not received a ViewMsg_WorkerCreated reply, but in the +// mean time it's destroyed. This tells the browser to not create the queued +// worker. +IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker, + int /* route_id */)
\ No newline at end of file diff --git a/content/content_common.gypi b/content/content_common.gypi index 56e36e0..6b20667e 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -9,6 +9,7 @@ 'type': '<(library)', 'dependencies': [ '../ipc/ipc.gyp:ipc', + '../skia/skia.gyp:skia', '../third_party/icu/icu.gyp:icuuc', '../third_party/npapi/npapi.gyp:npapi', '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', @@ -67,6 +68,7 @@ 'common/device_orientation_messages.h', 'common/dom_storage_common.h', 'common/dom_storage_messages.h', + 'common/drag_messages.h', 'common/dx_diag_node.cc', 'common/dx_diag_node.h', 'common/edit_command.h', diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc index 08af663..730976d 100644 --- a/content/renderer/render_view.cc +++ b/content/renderer/render_view.cc @@ -72,6 +72,7 @@ #include "content/common/clipboard_messages.h" #include "content/common/content_constants.h" #include "content/common/database_messages.h" +#include "content/common/drag_messages.h" #include "content/common/file_system/file_system_dispatcher.h" #include "content/common/file_system/webfilesystem_callback_dispatcher.h" #include "content/common/notification_service.h" @@ -1000,16 +1001,15 @@ bool RenderView::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest) IPC_MESSAGE_HANDLER(ViewMsg_CSSInsertRequest, OnCSSInsertRequest) IPC_MESSAGE_HANDLER(ViewMsg_ReservePageIDRange, OnReservePageIDRange) - IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragEnter, OnDragTargetDragEnter) - IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragOver, OnDragTargetDragOver) - IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragLeave, OnDragTargetDragLeave) - IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDrop, OnDragTargetDrop) + IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) + IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) + IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) + IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) + IPC_MESSAGE_HANDLER(DragMsg_SourceEndedOrMoved, OnDragSourceEndedOrMoved) + IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, + OnDragSourceSystemDragEnded) IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) IPC_MESSAGE_HANDLER(ViewMsg_SetWebUIProperty, OnSetWebUIProperty) - IPC_MESSAGE_HANDLER(ViewMsg_DragSourceEndedOrMoved, - OnDragSourceEndedOrMoved) - IPC_MESSAGE_HANDLER(ViewMsg_DragSourceSystemDragEnded, - OnDragSourceSystemDragEnded) IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) IPC_MESSAGE_HANDLER(ViewMsg_ScrollFocusedEditableNodeIntoView, OnScrollFocusedEditableNodeIntoView) @@ -2485,7 +2485,7 @@ void RenderView::startDragging(const WebDragData& data, SkBitmap bitmap = gfx::CGImageToSkBitmap(image.getCGImageRef()); #endif - Send(new ViewHostMsg_StartDragging(routing_id_, + Send(new DragHostMsg_StartDragging(routing_id_, WebDropData(data), mask, bitmap, @@ -4366,21 +4366,6 @@ void RenderView::OnReservePageIDRange(int size_of_range) { next_page_id_ += size_of_range + 1; } -void RenderView::OnDragSourceEndedOrMoved(const gfx::Point& client_point, - const gfx::Point& screen_point, - bool ended, - WebDragOperation op) { - if (ended) { - webview()->dragSourceEndedAt(client_point, screen_point, op); - } else { - webview()->dragSourceMovedTo(client_point, screen_point, op); - } -} - -void RenderView::OnDragSourceSystemDragEnded() { - webview()->dragSourceSystemDragEnded(); -} - void RenderView::OnDragTargetDragEnter(const WebDropData& drop_data, const gfx::Point& client_point, const gfx::Point& screen_point, @@ -4392,7 +4377,7 @@ void RenderView::OnDragTargetDragEnter(const WebDropData& drop_data, screen_point, ops); - Send(new ViewHostMsg_UpdateDragCursor(routing_id_, operation)); + Send(new DragHostMsg_UpdateDragCursor(routing_id_, operation)); } void RenderView::OnDragTargetDragOver(const gfx::Point& client_point, @@ -4403,7 +4388,7 @@ void RenderView::OnDragTargetDragOver(const gfx::Point& client_point, screen_point, ops); - Send(new ViewHostMsg_UpdateDragCursor(routing_id_, operation)); + Send(new DragHostMsg_UpdateDragCursor(routing_id_, operation)); } void RenderView::OnDragTargetDragLeave() { @@ -4415,6 +4400,21 @@ void RenderView::OnDragTargetDrop(const gfx::Point& client_point, webview()->dragTargetDrop(client_point, screen_point); } +void RenderView::OnDragSourceEndedOrMoved(const gfx::Point& client_point, + const gfx::Point& screen_point, + bool ended, + WebDragOperation op) { + if (ended) { + webview()->dragSourceEndedAt(client_point, screen_point, op); + } else { + webview()->dragSourceMovedTo(client_point, screen_point, op); + } +} + +void RenderView::OnDragSourceSystemDragEnded() { + webview()->dragSourceSystemDragEnded(); +} + void RenderView::OnUpdateWebPreferences(const WebPreferences& prefs) { webkit_preferences_ = prefs; webkit_preferences_.Apply(webview()); diff --git a/content/renderer/websharedworker_proxy.cc b/content/renderer/websharedworker_proxy.cc index 4af93e5..203ec6b 100644 --- a/content/renderer/websharedworker_proxy.cc +++ b/content/renderer/websharedworker_proxy.cc @@ -4,7 +4,7 @@ #include "content/renderer/websharedworker_proxy.h" -#include "chrome/common/render_messages.h" +#include "content/common/view_messages.h" #include "content/common/webmessageportchannel_impl.h" #include "content/common/worker_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" diff --git a/content/renderer/websharedworkerrepository_impl.cc b/content/renderer/websharedworkerrepository_impl.cc index 76c9bf1..d0f9566 100644 --- a/content/renderer/websharedworkerrepository_impl.cc +++ b/content/renderer/websharedworkerrepository_impl.cc @@ -4,8 +4,8 @@ #include "content/renderer/websharedworkerrepository_impl.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" +#include "content/common/view_messages.h" #include "content/renderer/websharedworker_proxy.h" WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {} diff --git a/content/renderer/webworker_base.cc b/content/renderer/webworker_base.cc index 0741e79..c8e1304 100644 --- a/content/renderer/webworker_base.cc +++ b/content/renderer/webworker_base.cc @@ -4,9 +4,8 @@ #include "content/renderer/webworker_base.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/render_messages_params.h" #include "content/common/child_thread.h" +#include "content/common/view_messages.h" #include "content/common/webmessageportchannel_impl.h" #include "content/common/worker_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" diff --git a/content/renderer/webworker_proxy.cc b/content/renderer/webworker_proxy.cc index 53f97df..9817f0f 100644 --- a/content/renderer/webworker_proxy.cc +++ b/content/renderer/webworker_proxy.cc @@ -4,8 +4,8 @@ #include "content/renderer/webworker_proxy.h" -#include "chrome/common/render_messages.h" #include "content/common/child_thread.h" +#include "content/common/view_messages.h" #include "content/common/webmessageportchannel_impl.h" #include "content/common/worker_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 145b23b..ce3aff8 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -82,6 +82,7 @@ enum IPCMessageStart { GeolocationMsgStart, AudioMsgStart, ChromeMsgStart, + DragMsgStart, LastIPCMsgStart // Must come last. }; |