[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 5 | // Multiply-included file, no traditional include guard. |
| 6 | #include <map> |
| 7 | #include <set> |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
[email protected] | 7a4de7a6 | 2010-08-17 18:38:24 | [diff] [blame] | 11 | // TODO(erg): This list has been temporarily annotated by erg while doing work |
| 12 | // on which headers to pull out. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 13 | #include "base/basictypes.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 14 | #include "base/file_path.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 15 | #include "base/process.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 16 | #include "base/shared_memory.h" |
[email protected] | 4c79e3e | 2009-10-23 18:31:32 | [diff] [blame] | 17 | #include "base/string16.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 18 | #include "base/values.h" |
| 19 | #include "build/build_config.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 20 | #include "chrome/common/content_settings.h" |
[email protected] | 1c9c7fb | 2011-03-11 16:38:38 | [diff] [blame] | 21 | #include "chrome/common/instant_types.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 22 | #include "chrome/common/nacl_types.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 23 | #include "chrome/common/render_messages_params.h" |
| 24 | #include "chrome/common/thumbnail_score.h" |
[email protected] | 152b8ba3 | 2010-03-29 19:40:16 | [diff] [blame] | 25 | #include "chrome/common/translate_errors.h" |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 26 | #include "chrome/common/view_types.h" |
[email protected] | db803aae | 2011-03-05 02:00:42 | [diff] [blame] | 27 | #include "content/common/common_param_traits.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 28 | #include "ipc/ipc_message_macros.h" |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 29 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 30 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 31 | #include "third_party/skia/include/core/SkBitmap.h" |
| 32 | #include "ui/gfx/rect.h" |
[email protected] | 7a4de7a6 | 2010-08-17 18:38:24 | [diff] [blame] | 33 | |
[email protected] | 44c49c9 | 2011-03-28 16:17:23 | [diff] [blame^] | 34 | // Singly-included section for enums and custom IPC traits. |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 35 | #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 36 | #define CHROME_COMMON_RENDER_MESSAGES_H_ |
[email protected] | 049eec2 | 2010-10-20 21:32:52 | [diff] [blame] | 37 | |
[email protected] | 770dd8b | 2010-05-24 18:11:39 | [diff] [blame] | 38 | // Values that may be OR'd together to form the 'flags' parameter of the |
| 39 | // ViewMsg_EnablePreferredSizeChangedMode message. |
| 40 | enum ViewHostMsg_EnablePreferredSizeChangedMode_Flags { |
| 41 | kPreferredSizeNothing, |
| 42 | kPreferredSizeWidth = 1 << 0, |
| 43 | // Requesting the height currently requires a polling loop in render_view.cc. |
| 44 | kPreferredSizeHeightThisIsSlow = 1 << 1, |
| 45 | }; |
| 46 | |
[email protected] | a6097f4 | 2011-01-10 08:50:51 | [diff] [blame] | 47 | // Command values for the cmd parameter of the |
| 48 | // ViewHost_JavaScriptStressTestControl message. For each command the parameter |
| 49 | // passed has a different meaning: |
| 50 | // For the command kJavaScriptStressTestSetStressRunType the parameter it the |
| 51 | // type taken from the enumeration v8::Testing::StressType. |
| 52 | // For the command kJavaScriptStressTestPrepareStressRun the parameter it the |
| 53 | // number of the stress run about to take place. |
| 54 | enum ViewHostMsg_JavaScriptStressTestControl_Commands { |
| 55 | kJavaScriptStressTestSetStressRunType = 0, |
| 56 | kJavaScriptStressTestPrepareStressRun = 1, |
| 57 | }; |
| 58 | |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 59 | namespace IPC { |
| 60 | |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 61 | #if defined(OS_POSIX) |
| 62 | |
| 63 | // TODO(port): this shouldn't exist. However, the plugin stuff is really using |
| 64 | // HWNDS (NativeView), and making Windows calls based on them. I've not figured |
| 65 | // out the deal with plugins yet. |
| 66 | template <> |
| 67 | struct ParamTraits<gfx::NativeView> { |
| 68 | typedef gfx::NativeView param_type; |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 69 | static void Write(Message* m, const param_type& p) { |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 70 | NOTIMPLEMENTED(); |
| 71 | } |
| 72 | |
[email protected] | 7d5c3ac | 2009-02-04 08:58:19 | [diff] [blame] | 73 | static bool Read(const Message* m, void** iter, param_type* p) { |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 74 | NOTIMPLEMENTED(); |
| 75 | *p = NULL; |
| 76 | return true; |
| 77 | } |
| 78 | |
[email protected] | 252cad6 | 2010-08-18 18:33:57 | [diff] [blame] | 79 | static void Log(const param_type& p, std::string* l) { |
[email protected] | 93f1052 | 2010-10-31 16:27:48 | [diff] [blame] | 80 | l->append(base::StringPrintf("<gfx::NativeView>")); |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 81 | } |
| 82 | }; |
| 83 | |
| 84 | #endif // defined(OS_POSIX) |
| 85 | |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 86 | template <> |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 87 | struct ParamTraits<ContentSettings> { |
| 88 | typedef ContentSettings param_type; |
| 89 | static void Write(Message* m, const param_type& p); |
| 90 | static bool Read(const Message* m, void** iter, param_type* r); |
| 91 | static void Log(const param_type& p, std::string* l); |
[email protected] | 7b291f9 | 2009-08-14 05:43:53 | [diff] [blame] | 92 | }; |
[email protected] | 1b9af29 | 2009-07-09 04:30:30 | [diff] [blame] | 93 | |
[email protected] | b3df5a4 | 2010-05-11 14:31:09 | [diff] [blame] | 94 | } // namespace IPC |
[email protected] | 9f4db51 | 2010-05-10 20:21:41 | [diff] [blame] | 95 | |
[email protected] | 5a52f16 | 2008-08-27 04:15:31 | [diff] [blame] | 96 | #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 97 | |
[email protected] | 778574e | 2011-03-21 22:03:50 | [diff] [blame] | 98 | #define IPC_MESSAGE_START ChromeMsgStart |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 99 | |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 100 | IPC_ENUM_TRAITS(ContentSetting) |
| 101 | IPC_ENUM_TRAITS(ContentSettingsType) |
| 102 | IPC_ENUM_TRAITS(InstantCompleteBehavior) |
| 103 | IPC_ENUM_TRAITS(TranslateErrors::Type) |
| 104 | IPC_ENUM_TRAITS(ViewType::Type) |
| 105 | IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 106 | |
| 107 | IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) |
| 108 | IPC_STRUCT_TRAITS_MEMBER(boring_score) |
| 109 | IPC_STRUCT_TRAITS_MEMBER(good_clipping) |
| 110 | IPC_STRUCT_TRAITS_MEMBER(at_top) |
| 111 | IPC_STRUCT_TRAITS_MEMBER(time_at_snapshot) |
| 112 | IPC_STRUCT_TRAITS_END() |
| 113 | |
[email protected] | fffaf97 | 2011-03-24 01:34:35 | [diff] [blame] | 114 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::ResourceTypeStat) |
| 115 | IPC_STRUCT_TRAITS_MEMBER(count) |
| 116 | IPC_STRUCT_TRAITS_MEMBER(size) |
| 117 | IPC_STRUCT_TRAITS_MEMBER(liveSize) |
| 118 | IPC_STRUCT_TRAITS_MEMBER(decodedSize) |
| 119 | IPC_STRUCT_TRAITS_END() |
| 120 | |
| 121 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::ResourceTypeStats) |
| 122 | IPC_STRUCT_TRAITS_MEMBER(images) |
| 123 | IPC_STRUCT_TRAITS_MEMBER(cssStyleSheets) |
| 124 | IPC_STRUCT_TRAITS_MEMBER(scripts) |
| 125 | IPC_STRUCT_TRAITS_MEMBER(xslStyleSheets) |
| 126 | IPC_STRUCT_TRAITS_MEMBER(fonts) |
| 127 | IPC_STRUCT_TRAITS_END() |
| 128 | |
| 129 | IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCache::UsageStats) |
| 130 | IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity) |
| 131 | IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity) |
| 132 | IPC_STRUCT_TRAITS_MEMBER(capacity) |
| 133 | IPC_STRUCT_TRAITS_MEMBER(liveSize) |
| 134 | IPC_STRUCT_TRAITS_MEMBER(deadSize) |
| 135 | IPC_STRUCT_TRAITS_END() |
| 136 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 137 | //----------------------------------------------------------------------------- |
| 138 | // RenderView messages |
| 139 | // These are messages sent from the browser to the renderer process. |
| 140 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 141 | // Tells the renderer to set its maximum cache size to the supplied value. |
| 142 | IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, |
| 143 | size_t /* min_dead_capacity */, |
| 144 | size_t /* max_dead_capacity */, |
| 145 | size_t /* capacity */) |
| 146 | |
| 147 | // Tells the renderer to clear the cache. |
| 148 | IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) |
| 149 | |
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 150 | // Tells the renderer to dump as much memory as it can, perhaps because we |
| 151 | // have memory pressure or the renderer is (or will be) paged out. This |
| 152 | // should only result in purging objects we can recalculate, e.g. caches or |
| 153 | // JS garbage, not in purging irreplaceable objects. |
| 154 | IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory) |
| 155 | |
| 156 | // Tells the render view to capture a thumbnail image of the page. The |
| 157 | // render view responds with a ViewHostMsg_Snapshot. |
| 158 | IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot) |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 159 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 160 | // History system notification that the visited link database has been |
| 161 | // replaced. It has one SharedMemoryHandle argument consisting of the table |
| 162 | // handle. This handle is valid in the context of the renderer |
| 163 | IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, base::SharedMemoryHandle) |
| 164 | |
| 165 | // History system notification that a link has been added and the link |
| 166 | // coloring state for the given hash must be re-calculated. |
| 167 | IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_Add, std::vector<uint64>) |
| 168 | |
| 169 | // History system notification that one or more history items have been |
| 170 | // deleted, which at this point means that all link coloring state must be |
| 171 | // re-calculated. |
| 172 | IPC_MESSAGE_CONTROL0(ViewMsg_VisitedLink_Reset) |
| 173 | |
| 174 | // Notification that the user scripts have been updated. It has one |
| 175 | // SharedMemoryHandle argument consisting of the pickled script data. This |
| 176 | // handle is valid in the context of the renderer. |
| 177 | IPC_MESSAGE_CONTROL1(ViewMsg_UserScripts_UpdatedScripts, |
| 178 | base::SharedMemoryHandle) |
| 179 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 180 | // Sent when user prompting is required before a ViewHostMsg_GetCookies |
| 181 | // message can complete. This message indicates that the renderer should |
| 182 | // pump messages while waiting for cookies. |
| 183 | IPC_MESSAGE_CONTROL0(ViewMsg_SignalCookiePromptEvent) |
| 184 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 185 | // Set the content settings for a particular url that the renderer is in the |
| 186 | // process of loading. This will be stored, to be used if the load commits |
| 187 | // and ignored otherwise. |
| 188 | IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, |
| 189 | GURL /* url */, |
| 190 | ContentSettings /* content_settings */) |
| 191 | |
| 192 | // Set the content settings for a particular url, so all render views |
| 193 | // displaying this host url update their content settings to match. |
| 194 | IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, |
| 195 | GURL /* url */, |
| 196 | ContentSettings /* content_settings */) |
| 197 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 198 | // Install the first missing pluign. |
| 199 | IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin) |
| 200 | |
| 201 | // Tells the renderer to empty its plugin list cache, optional reloading |
| 202 | // pages containing plugins. |
| 203 | IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache, |
| 204 | bool /* reload_pages */) |
| 205 | |
| 206 | // Tells the render view to load all blocked plugins. |
| 207 | IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) |
| 208 | |
| 209 | // Tells the render view a prerendered page is about to be displayed. |
| 210 | IPC_MESSAGE_ROUTED0(ViewMsg_DisplayPrerenderedPage) |
| 211 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 212 | // Used to instruct the RenderView to go into "view source" mode. |
| 213 | IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) |
| 214 | |
| 215 | // Get all savable resource links from current webpage, include main |
| 216 | // frame and sub-frame. |
| 217 | IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, |
| 218 | GURL /* url of page which is needed to save */) |
| 219 | |
| 220 | // Get html data by serializing all frames of current page with lists |
| 221 | // which contain all resource links that have local copy. |
| 222 | IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, |
| 223 | std::vector<GURL> /* urls that have local copy */, |
| 224 | std::vector<FilePath> /* paths of local copy */, |
| 225 | FilePath /* local directory path */) |
| 226 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 227 | // Requests the renderer to download the specified favicon image encode it as |
[email protected] | d8e74e8 | 2011-03-15 19:38:48 | [diff] [blame] | 228 | // PNG and send the PNG data back ala ViewHostMsg_DidDownloadFavicon. |
| 229 | IPC_MESSAGE_ROUTED3(ViewMsg_DownloadFavicon, |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 230 | int /* identifier for the request */, |
| 231 | GURL /* URL of the image */, |
| 232 | int /* Size of the image. Normally 0, but set if you have |
| 233 | a preferred image size to request, such as when |
| 234 | downloading the favicon */) |
| 235 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 236 | // Asks the renderer to send back stats on the WebCore cache broken down by |
| 237 | // resource types. |
| 238 | IPC_MESSAGE_CONTROL0(ViewMsg_GetCacheResourceStats) |
| 239 | |
| 240 | // Asks the renderer to send back Histograms. |
| 241 | IPC_MESSAGE_CONTROL1(ViewMsg_GetRendererHistograms, |
| 242 | int /* sequence number of Renderer Histograms. */) |
| 243 | |
| 244 | #if defined(USE_TCMALLOC) |
| 245 | // Asks the renderer to send back tcmalloc stats. |
| 246 | IPC_MESSAGE_CONTROL0(ViewMsg_GetRendererTcmalloc) |
| 247 | #endif |
| 248 | |
| 249 | // Asks the renderer to send back V8 heap stats. |
| 250 | IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) |
| 251 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 252 | // Posts a message to the renderer. |
| 253 | IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, |
| 254 | std::string /* The message */, |
| 255 | std::string /* The origin */, |
| 256 | std::string /* The target*/) |
| 257 | |
| 258 | // Sent to the renderer when a popup window should no longer count against |
| 259 | // the current popup count (either because it's not a popup or because it was |
| 260 | // a generated by a user action or because a constrained popup got turned |
| 261 | // into a full window). |
| 262 | IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) |
| 263 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 264 | // Sent by the Browser process to alert a window about whether a it should |
| 265 | // allow a scripted window.close(). The renderer assumes every new window is a |
| 266 | // blocked popup until notified otherwise. |
| 267 | IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, |
| 268 | bool /* script_can_close */) |
| 269 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 270 | IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, |
| 271 | string16 /* value */, |
| 272 | bool /* verbatim */, |
| 273 | int /* selection_start */, |
| 274 | int /* selection_end */) |
| 275 | IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, |
| 276 | string16 /* value */, |
| 277 | bool /* verbatim */) |
| 278 | IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) |
| 279 | IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, |
| 280 | gfx::Rect /* search_box_bounds */) |
| 281 | IPC_MESSAGE_ROUTED4(ViewMsg_DetermineIfPageSupportsInstant, |
| 282 | string16 /* value*/, |
| 283 | bool /* verbatim */, |
| 284 | int /* selection_start */, |
| 285 | int /* selection_end */) |
| 286 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 287 | // Tell the renderer which browser window it's being attached to. |
| 288 | IPC_MESSAGE_ROUTED1(ViewMsg_UpdateBrowserWindowId, |
| 289 | int /* id of browser window */) |
| 290 | |
| 291 | // Tell the renderer which type this view is. |
| 292 | IPC_MESSAGE_ROUTED1(ViewMsg_NotifyRenderViewType, |
| 293 | ViewType::Type /* view_type */) |
| 294 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 295 | // Tells the renderer to translate the page contents from one language to |
| 296 | // another. |
| 297 | IPC_MESSAGE_ROUTED4(ViewMsg_TranslatePage, |
| 298 | int /* page id */, |
| 299 | std::string, /* the script injected in the page */ |
| 300 | std::string, /* BCP 47/RFC 5646 language code the page |
| 301 | is in */ |
| 302 | std::string /* BCP 47/RFC 5646 language code to translate |
| 303 | to */) |
| 304 | |
| 305 | // Tells the renderer to revert the text of translated page to its original |
| 306 | // contents. |
| 307 | IPC_MESSAGE_ROUTED1(ViewMsg_RevertTranslation, |
| 308 | int /* page id */) |
| 309 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 310 | // Sent on process startup to indicate whether this process is running in |
| 311 | // incognito mode. |
| 312 | IPC_MESSAGE_CONTROL1(ViewMsg_SetIsIncognitoProcess, |
| 313 | bool /* is_incognito_processs */) |
| 314 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 315 | //----------------------------------------------------------------------------- |
| 316 | // TabContents messages |
| 317 | // These are messages sent from the renderer to the browser process. |
| 318 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 319 | IPC_MESSAGE_CONTROL1(ViewHostMsg_UpdatedCacheStats, |
| 320 | WebKit::WebCache::UsageStats /* stats */) |
| 321 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 322 | // Tells the browser that content in the current page was blocked due to the |
| 323 | // user's content settings. |
| 324 | IPC_MESSAGE_ROUTED2(ViewHostMsg_ContentBlocked, |
| 325 | ContentSettingsType, /* type of blocked content */ |
| 326 | std::string /* resource identifier */) |
| 327 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 328 | // Specifies the URL as the first parameter (a wstring) and thumbnail as |
| 329 | // binary data as the second parameter. |
| 330 | IPC_MESSAGE_ROUTED3(ViewHostMsg_Thumbnail, |
| 331 | GURL /* url */, |
| 332 | ThumbnailScore /* score */, |
| 333 | SkBitmap /* bitmap */) |
| 334 | |
| 335 | // Send a snapshot of the tab contents to the render host. |
| 336 | IPC_MESSAGE_ROUTED1(ViewHostMsg_Snapshot, |
| 337 | SkBitmap /* bitmap */) |
| 338 | |
| 339 | // Notification that the url for the favicon of a site has been determined. |
[email protected] | d8e74e8 | 2011-03-15 19:38:48 | [diff] [blame] | 340 | IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFaviconURL, |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 341 | int32 /* page_id */, |
| 342 | GURL /* url of the favicon */) |
| 343 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 344 | // Following message is used to communicate the values received by the |
| 345 | // callback binding the JS to Cpp. |
| 346 | // An instance of browser that has an automation host listening to it can |
| 347 | // have a javascript send a native value (string, number, boolean) to the |
| 348 | // listener in Cpp. (DomAutomationController) |
| 349 | IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse, |
| 350 | std::string /* json_string */, |
| 351 | int /* automation_id */) |
| 352 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 353 | // A message for an external host. |
| 354 | IPC_MESSAGE_ROUTED3(ViewHostMsg_ForwardMessageToExternalHost, |
| 355 | std::string /* message */, |
| 356 | std::string /* origin */, |
| 357 | std::string /* target */) |
| 358 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 359 | // A renderer sends this to the browser process when it wants to start |
| 360 | // a new instance of the Native Client process. The browser will launch |
| 361 | // the process and return a handle to an IMC channel. |
| 362 | IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_LaunchNaCl, |
| 363 | std::wstring /* url for the NaCl module */, |
| 364 | int /* socket count */, |
| 365 | std::vector<nacl::FileDescriptor> |
| 366 | /* imc channel handles */, |
| 367 | base::ProcessHandle /* NaCl process handle */, |
| 368 | base::ProcessId /* NaCl process id */) |
| 369 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 370 | // Notification that the page has an OpenSearch description document |
| 371 | // associated with it. |
| 372 | IPC_MESSAGE_ROUTED3(ViewHostMsg_PageHasOSDD, |
| 373 | int32 /* page_id */, |
| 374 | GURL /* url of OS description document */, |
| 375 | ViewHostMsg_PageHasOSDD_Type) |
| 376 | |
| 377 | // Find out if the given url's security origin is installed as a search |
| 378 | // provider. |
| 379 | IPC_SYNC_MESSAGE_ROUTED2_1( |
| 380 | ViewHostMsg_GetSearchProviderInstallState, |
| 381 | GURL /* page url */, |
| 382 | GURL /* inquiry url */, |
| 383 | ViewHostMsg_GetSearchProviderInstallState_Params /* install */) |
| 384 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 385 | // Stores new inspector setting in the profile. |
| 386 | IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting, |
| 387 | std::string, /* key */ |
| 388 | std::string /* value */) |
| 389 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 390 | // Send back a string to be recorded by UserMetrics. |
| 391 | IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, |
| 392 | std::string /* action */) |
| 393 | |
| 394 | // Send back histograms as vector of pickled-histogram strings. |
| 395 | IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, |
| 396 | int, /* sequence number of Renderer Histograms. */ |
| 397 | std::vector<std::string>) |
| 398 | |
| 399 | #if defined USE_TCMALLOC |
| 400 | // Send back tcmalloc stats output. |
| 401 | IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, |
| 402 | int /* pid */, |
| 403 | std::string /* tcmalloc debug output */) |
| 404 | #endif |
| 405 | |
| 406 | // Sends back stats about the V8 heap. |
| 407 | IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, |
| 408 | int /* size of heap (allocated from the OS) */, |
| 409 | int /* bytes in use */) |
| 410 | |
| 411 | // Request for a DNS prefetch of the names in the array. |
| 412 | // NameList is typedef'ed std::vector<std::string> |
| 413 | IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, |
| 414 | std::vector<std::string> /* hostnames */) |
| 415 | |
| 416 | // Notifies when default plugin updates status of the missing plugin. |
| 417 | IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus, |
| 418 | int /* status */) |
| 419 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 420 | // Notifies when a plugin couldn't be loaded because it's outdated. |
| 421 | IPC_MESSAGE_ROUTED2(ViewHostMsg_BlockedOutdatedPlugin, |
| 422 | string16, /* name */ |
| 423 | GURL /* update_url */) |
| 424 | |
| 425 | // Displays a JavaScript out-of-memory message in the infobar. |
| 426 | IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory) |
| 427 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 428 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, |
| 429 | std::vector<GURL> /* all savable resource links */, |
| 430 | std::vector<GURL> /* all referrers of resource links */, |
| 431 | std::vector<GURL> /* all frame links */) |
| 432 | |
| 433 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, |
| 434 | GURL /* frame's url */, |
| 435 | std::string /* data buffer */, |
| 436 | int32 /* complete status */) |
| 437 | |
[email protected] | d8e74e8 | 2011-03-15 19:38:48 | [diff] [blame] | 438 | IPC_MESSAGE_ROUTED4(ViewHostMsg_DidDownloadFavicon, |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 439 | int /* Identifier of the request */, |
| 440 | GURL /* URL of the image */, |
| 441 | bool /* true if there was a network error */, |
| 442 | SkBitmap /* image_data */) |
| 443 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 444 | // Provide the browser process with information about the WebCore resource |
| 445 | // cache. |
| 446 | IPC_MESSAGE_CONTROL1(ViewHostMsg_ResourceTypeStats, |
| 447 | WebKit::WebCache::ResourceTypeStats) |
| 448 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 449 | // Message sent from renderer to the browser to update the state of a command. |
| 450 | // The |command| parameter is a RenderViewCommand. The |checked_state| parameter |
| 451 | // is a CommandCheckedState. |
| 452 | IPC_MESSAGE_ROUTED3(ViewHostMsg_CommandStateChanged, |
| 453 | int /* command */, |
| 454 | bool /* is_enabled */, |
| 455 | int /* checked_state */) |
| 456 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 457 | |
| 458 | // Notifies the browser of the language (ISO 639_1 code language, such as fr, |
| 459 | // en, zh...) of the current page. |
| 460 | IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, |
| 461 | std::string /* the language */) |
| 462 | |
| 463 | // Notifies the browser that a page has been translated. |
| 464 | IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, |
| 465 | int, /* page id */ |
| 466 | std::string /* the original language */, |
| 467 | std::string /* the translated language */, |
| 468 | TranslateErrors::Type /* the error type if available */) |
| 469 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 470 | // Suggest results ----------------------------------------------------------- |
| 471 | |
| 472 | IPC_MESSAGE_ROUTED3(ViewHostMsg_SetSuggestions, |
| 473 | int32 /* page_id */, |
| 474 | std::vector<std::string> /* suggestions */, |
| 475 | InstantCompleteBehavior) |
| 476 | |
| 477 | IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, |
| 478 | int32 /* page_id */, |
| 479 | bool /* result */) |
| 480 | |
[email protected] | d5a0483 | 2011-03-12 21:46:26 | [diff] [blame] | 481 | // Updates the content restrictions, i.e. to disable print/copy. |
| 482 | IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions, |
| 483 | int /* restrictions */) |
| 484 | |
| 485 | // The currently displayed PDF has an unsupported feature. |
| 486 | IPC_MESSAGE_ROUTED0(ViewHostMsg_PDFHasUnsupportedFeature) |
| 487 | |
| 488 | // JavaScript related messages ----------------------------------------------- |
| 489 | |
| 490 | // Notify the JavaScript engine in the render to change its parameters |
| 491 | // while performing stress testing. |
| 492 | IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, |
| 493 | int /* cmd */, |
| 494 | int /* param */) |
| 495 | |
| 496 | // Register a new handler for URL requests with the given scheme. |
| 497 | IPC_MESSAGE_ROUTED3(ViewHostMsg_RegisterProtocolHandler, |
| 498 | std::string /* scheme */, |
| 499 | GURL /* url */, |
| 500 | string16 /* title */) |