| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Multiply-included file, no traditional include guard. | 5 // Multiply-included file, no traditional include guard. |
| 6 #include <map> | 6 #include <map> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 // TODO(erg): This list has been temporarily annotated by erg while doing work | 11 // TODO(erg): This list has been temporarily annotated by erg while doing work |
| 12 // on which headers to pull out. | 12 // on which headers to pull out. |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/process.h" | 15 #include "base/process.h" |
| 16 #include "base/shared_memory.h" | 16 #include "base/shared_memory.h" |
| 17 #include "base/string16.h" | 17 #include "base/string16.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "chrome/common/common_param_traits.h" | 20 #include "chrome/common/common_param_traits.h" |
| 21 #include "chrome/common/icon_messages.h" | 21 #include "chrome/common/icon_messages.h" |
| 22 #include "chrome/common/instant_types.h" | 22 #include "chrome/common/instant_types.h" |
| 23 #include "chrome/common/nacl_types.h" | 23 #include "chrome/common/nacl_types.h" |
| 24 #include "chrome/common/prerender_constants.h" | |
| 25 #include "chrome/common/search_provider.h" | 24 #include "chrome/common/search_provider.h" |
| 26 #include "chrome/common/thumbnail_score.h" | 25 #include "chrome/common/thumbnail_score.h" |
| 27 #include "chrome/common/translate_errors.h" | 26 #include "chrome/common/translate_errors.h" |
| 28 #include "chrome/common/view_types.h" | 27 #include "chrome/common/view_types.h" |
| 29 #include "content/common/common_param_traits.h" | 28 #include "content/common/common_param_traits.h" |
| 30 #include "ipc/ipc_message_macros.h" | 29 #include "ipc/ipc_message_macros.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 33 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
| 34 #include "ui/gfx/rect.h" | 33 #include "ui/gfx/rect.h" |
| 35 | 34 |
| 36 // Singly-included section for enums and custom IPC traits. | 35 // Singly-included section for enums and custom IPC traits. |
| 37 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 36 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 38 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 37 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 39 | 38 |
| 40 // Values that may be OR'd together to form the 'flags' parameter of the | |
| 41 // ViewMsg_EnablePreferredSizeChangedMode message. | |
| 42 enum ViewHostMsg_EnablePreferredSizeChangedMode_Flags { | |
| 43 kPreferredSizeNothing, | |
| 44 kPreferredSizeWidth = 1 << 0, | |
| 45 // Requesting the height currently requires a polling loop in render_view.cc. | |
| 46 kPreferredSizeHeightThisIsSlow = 1 << 1, | |
| 47 }; | |
| 48 | |
| 49 // Command values for the cmd parameter of the | 39 // Command values for the cmd parameter of the |
| 50 // ViewHost_JavaScriptStressTestControl message. For each command the parameter | 40 // ViewHost_JavaScriptStressTestControl message. For each command the parameter |
| 51 // passed has a different meaning: | 41 // passed has a different meaning: |
| 52 // For the command kJavaScriptStressTestSetStressRunType the parameter it the | 42 // For the command kJavaScriptStressTestSetStressRunType the parameter it the |
| 53 // type taken from the enumeration v8::Testing::StressType. | 43 // type taken from the enumeration v8::Testing::StressType. |
| 54 // For the command kJavaScriptStressTestPrepareStressRun the parameter it the | 44 // For the command kJavaScriptStressTestPrepareStressRun the parameter it the |
| 55 // number of the stress run about to take place. | 45 // number of the stress run about to take place. |
| 56 enum ViewHostMsg_JavaScriptStressTestControl_Commands { | 46 enum ViewHostMsg_JavaScriptStressTestControl_Commands { |
| 57 kJavaScriptStressTestSetStressRunType = 0, | 47 kJavaScriptStressTestSetStressRunType = 0, |
| 58 kJavaScriptStressTestPrepareStressRun = 1, | 48 kJavaScriptStressTestPrepareStressRun = 1, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 static void Log(const param_type& p, std::string* l); | 83 static void Log(const param_type& p, std::string* l); |
| 94 }; | 84 }; |
| 95 | 85 |
| 96 } // namespace IPC | 86 } // namespace IPC |
| 97 | 87 |
| 98 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 88 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| 99 | 89 |
| 100 #define IPC_MESSAGE_START ChromeMsgStart | 90 #define IPC_MESSAGE_START ChromeMsgStart |
| 101 | 91 |
| 102 IPC_ENUM_TRAITS(InstantCompleteBehavior) | 92 IPC_ENUM_TRAITS(InstantCompleteBehavior) |
| 103 IPC_ENUM_TRAITS(prerender::PrerenderCancellationReason) | |
| 104 IPC_ENUM_TRAITS(search_provider::OSDDType) | 93 IPC_ENUM_TRAITS(search_provider::OSDDType) |
| 105 IPC_ENUM_TRAITS(search_provider::InstallState) | 94 IPC_ENUM_TRAITS(search_provider::InstallState) |
| 106 IPC_ENUM_TRAITS(TranslateErrors::Type) | 95 IPC_ENUM_TRAITS(TranslateErrors::Type) |
| 107 IPC_ENUM_TRAITS(ViewType::Type) | 96 IPC_ENUM_TRAITS(ViewType::Type) |
| 108 IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) | 97 IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level) |
| 109 | 98 |
| 110 IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) | 99 IPC_STRUCT_TRAITS_BEGIN(ThumbnailScore) |
| 111 IPC_STRUCT_TRAITS_MEMBER(boring_score) | 100 IPC_STRUCT_TRAITS_MEMBER(boring_score) |
| 112 IPC_STRUCT_TRAITS_MEMBER(good_clipping) | 101 IPC_STRUCT_TRAITS_MEMBER(good_clipping) |
| 113 IPC_STRUCT_TRAITS_MEMBER(at_top) | 102 IPC_STRUCT_TRAITS_MEMBER(at_top) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, | 169 IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, |
| 181 GURL /* url */, | 170 GURL /* url */, |
| 182 ContentSettings /* content_settings */) | 171 ContentSettings /* content_settings */) |
| 183 | 172 |
| 184 // Set the content settings for a particular url, so all render views | 173 // Set the content settings for a particular url, so all render views |
| 185 // displaying this host url update their content settings to match. | 174 // displaying this host url update their content settings to match. |
| 186 IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, | 175 IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, |
| 187 GURL /* url */, | 176 GURL /* url */, |
| 188 ContentSettings /* content_settings */) | 177 ContentSettings /* content_settings */) |
| 189 | 178 |
| 190 // Install the first missing pluign. | |
| 191 IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin) | |
| 192 | |
| 193 // Tells the render view to load all blocked plugins. | 179 // Tells the render view to load all blocked plugins. |
| 194 IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) | 180 IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) |
| 195 | 181 |
| 196 // Tells the render view a prerendered page is about to be displayed. | |
| 197 IPC_MESSAGE_ROUTED0(ViewMsg_DisplayPrerenderedPage) | |
| 198 | |
| 199 // Used to instruct the RenderView to go into "view source" mode. | 182 // Used to instruct the RenderView to go into "view source" mode. |
| 200 IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) | 183 IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) |
| 201 | 184 |
| 202 // Get all savable resource links from current webpage, include main | 185 // Get all savable resource links from current webpage, include main |
| 203 // frame and sub-frame. | 186 // frame and sub-frame. |
| 204 IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, | 187 IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, |
| 205 GURL /* url of page which is needed to save */) | 188 GURL /* url of page which is needed to save */) |
| 206 | 189 |
| 207 // Get html data by serializing all frames of current page with lists | 190 // Get html data by serializing all frames of current page with lists |
| 208 // which contain all resource links that have local copy. | 191 // which contain all resource links that have local copy. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 235 | 218 |
| 236 // Asks the renderer to send back V8 heap stats. | 219 // Asks the renderer to send back V8 heap stats. |
| 237 IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) | 220 IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) |
| 238 | 221 |
| 239 // Posts a message to the renderer. | 222 // Posts a message to the renderer. |
| 240 IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, | 223 IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, |
| 241 std::string /* The message */, | 224 std::string /* The message */, |
| 242 std::string /* The origin */, | 225 std::string /* The origin */, |
| 243 std::string /* The target*/) | 226 std::string /* The target*/) |
| 244 | 227 |
| 245 // Sent to the renderer when a popup window should no longer count against | |
| 246 // the current popup count (either because it's not a popup or because it was | |
| 247 // a generated by a user action or because a constrained popup got turned | |
| 248 // into a full window). | |
| 249 IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) | |
| 250 | |
| 251 // Sent by the Browser process to alert a window about whether a it should | |
| 252 // allow a scripted window.close(). The renderer assumes every new window is a | |
| 253 // blocked popup until notified otherwise. | |
| 254 IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, | |
| 255 bool /* script_can_close */) | |
| 256 | |
| 257 IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, | 228 IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, |
| 258 string16 /* value */, | 229 string16 /* value */, |
| 259 bool /* verbatim */, | 230 bool /* verbatim */, |
| 260 int /* selection_start */, | 231 int /* selection_start */, |
| 261 int /* selection_end */) | 232 int /* selection_end */) |
| 262 IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, | 233 IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, |
| 263 string16 /* value */, | 234 string16 /* value */, |
| 264 bool /* verbatim */) | 235 bool /* verbatim */) |
| 265 IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) | 236 IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) |
| 266 IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, | 237 IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 GURL /* url of OS description document */, | 343 GURL /* url of OS description document */, |
| 373 search_provider::OSDDType) | 344 search_provider::OSDDType) |
| 374 | 345 |
| 375 // Find out if the given url's security origin is installed as a search | 346 // Find out if the given url's security origin is installed as a search |
| 376 // provider. | 347 // provider. |
| 377 IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetSearchProviderInstallState, | 348 IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetSearchProviderInstallState, |
| 378 GURL /* page url */, | 349 GURL /* page url */, |
| 379 GURL /* inquiry url */, | 350 GURL /* inquiry url */, |
| 380 search_provider::InstallState /* install */) | 351 search_provider::InstallState /* install */) |
| 381 | 352 |
| 382 // Stores new inspector setting in the profile. | |
| 383 IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting, | |
| 384 std::string, /* key */ | |
| 385 std::string /* value */) | |
| 386 | |
| 387 // Send back a string to be recorded by UserMetrics. | 353 // Send back a string to be recorded by UserMetrics. |
| 388 IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, | 354 IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, |
| 389 std::string /* action */) | 355 std::string /* action */) |
| 390 | 356 |
| 391 // Send back histograms as vector of pickled-histogram strings. | 357 // Send back histograms as vector of pickled-histogram strings. |
| 392 IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, | 358 IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, |
| 393 int, /* sequence number of Renderer Histograms. */ | 359 int, /* sequence number of Renderer Histograms. */ |
| 394 std::vector<std::string>) | 360 std::vector<std::string>) |
| 395 | 361 |
| 396 #if defined USE_TCMALLOC | 362 #if defined USE_TCMALLOC |
| 397 // Send back tcmalloc stats output. | 363 // Send back tcmalloc stats output. |
| 398 IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, | 364 IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, |
| 399 int /* pid */, | 365 int /* pid */, |
| 400 std::string /* tcmalloc debug output */) | 366 std::string /* tcmalloc debug output */) |
| 401 #endif | 367 #endif |
| 402 | 368 |
| 403 // Sends back stats about the V8 heap. | 369 // Sends back stats about the V8 heap. |
| 404 IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, | 370 IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, |
| 405 int /* size of heap (allocated from the OS) */, | 371 int /* size of heap (allocated from the OS) */, |
| 406 int /* bytes in use */) | 372 int /* bytes in use */) |
| 407 | 373 |
| 408 // Request for a DNS prefetch of the names in the array. | 374 // Request for a DNS prefetch of the names in the array. |
| 409 // NameList is typedef'ed std::vector<std::string> | 375 // NameList is typedef'ed std::vector<std::string> |
| 410 IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, | 376 IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, |
| 411 std::vector<std::string> /* hostnames */) | 377 std::vector<std::string> /* hostnames */) |
| 412 | 378 |
| 413 // Notifies when default plugin updates status of the missing plugin. | |
| 414 IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus, | |
| 415 int /* status */) | |
| 416 | |
| 417 // Requests the outdated plugins policy. | 379 // Requests the outdated plugins policy. |
| 418 // |policy| is one of ALLOW, BLOCK or ASK. Anything else is an error. | 380 // |policy| is one of ALLOW, BLOCK or ASK. Anything else is an error. |
| 419 // ALLOW means that outdated plugins are allowed, and BLOCK that they should | 381 // ALLOW means that outdated plugins are allowed, and BLOCK that they should |
| 420 // be blocked. The default is ASK, which blocks the plugin initially but allows | 382 // be blocked. The default is ASK, which blocks the plugin initially but allows |
| 421 // the user to start them manually. | 383 // the user to start them manually. |
| 422 IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetOutdatedPluginsPolicy, | 384 IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetOutdatedPluginsPolicy, |
| 423 ContentSetting /* policy */) | 385 ContentSetting /* policy */) |
| 424 | 386 |
| 425 // Notifies when a plugin couldn't be loaded because it's outdated. | 387 // Notifies when a plugin couldn't be loaded because it's outdated. |
| 426 IPC_MESSAGE_ROUTED2(ViewHostMsg_BlockedOutdatedPlugin, | 388 IPC_MESSAGE_ROUTED2(ViewHostMsg_BlockedOutdatedPlugin, |
| 427 string16, /* name */ | 389 string16, /* name */ |
| 428 GURL /* update_url */) | 390 GURL /* update_url */) |
| 429 | 391 |
| 430 // Displays a JavaScript out-of-memory message in the infobar. | |
| 431 IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory) | |
| 432 | |
| 433 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, | 392 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, |
| 434 std::vector<GURL> /* all savable resource links */, | 393 std::vector<GURL> /* all savable resource links */, |
| 435 std::vector<GURL> /* all referrers of resource links */, | 394 std::vector<GURL> /* all referrers of resource links */, |
| 436 std::vector<GURL> /* all frame links */) | 395 std::vector<GURL> /* all frame links */) |
| 437 | 396 |
| 438 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, | 397 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, |
| 439 GURL /* frame's url */, | 398 GURL /* frame's url */, |
| 440 std::string /* data buffer */, | 399 std::string /* data buffer */, |
| 441 int32 /* complete status */) | 400 int32 /* complete status */) |
| 442 | 401 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 465 IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, | 424 IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, |
| 466 std::string /* the language */) | 425 std::string /* the language */) |
| 467 | 426 |
| 468 // Notifies the browser that a page has been translated. | 427 // Notifies the browser that a page has been translated. |
| 469 IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, | 428 IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, |
| 470 int, /* page id */ | 429 int, /* page id */ |
| 471 std::string /* the original language */, | 430 std::string /* the original language */, |
| 472 std::string /* the translated language */, | 431 std::string /* the translated language */, |
| 473 TranslateErrors::Type /* the error type if available */) | 432 TranslateErrors::Type /* the error type if available */) |
| 474 | 433 |
| 475 // Message sent from the renderer to the browser to notify it of events which | |
| 476 // may lead to the cancellation of a prerender. The message is sent only when | |
| 477 // the renderer is in prerender mode. | |
| 478 IPC_MESSAGE_ROUTED1(ViewHostMsg_MaybeCancelPrerender, | |
| 479 prerender::PrerenderCancellationReason) | |
| 480 | |
| 481 // Suggest results ----------------------------------------------------------- | 434 // Suggest results ----------------------------------------------------------- |
| 482 | 435 |
| 483 IPC_MESSAGE_ROUTED3(ViewHostMsg_SetSuggestions, | 436 IPC_MESSAGE_ROUTED3(ViewHostMsg_SetSuggestions, |
| 484 int32 /* page_id */, | 437 int32 /* page_id */, |
| 485 std::vector<std::string> /* suggestions */, | 438 std::vector<std::string> /* suggestions */, |
| 486 InstantCompleteBehavior) | 439 InstantCompleteBehavior) |
| 487 | 440 |
| 488 IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, | 441 IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, |
| 489 int32 /* page_id */, | 442 int32 /* page_id */, |
| 490 bool /* result */) | 443 bool /* result */) |
| 491 | 444 |
| 492 // Updates the content restrictions, i.e. to disable print/copy. | |
| 493 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions, | |
| 494 int /* restrictions */) | |
| 495 | |
| 496 // The currently displayed PDF has an unsupported feature. | |
| 497 IPC_MESSAGE_ROUTED0(ViewHostMsg_PDFHasUnsupportedFeature) | |
| 498 | |
| 499 // Brings up SaveAs... dialog (similar to the wrench->SaveAs...). | |
| 500 IPC_MESSAGE_ROUTED0(ViewHostMsg_SaveAs) | |
| 501 | |
| 502 // JavaScript related messages ----------------------------------------------- | 445 // JavaScript related messages ----------------------------------------------- |
| 503 | 446 |
| 504 // Notify the JavaScript engine in the render to change its parameters | 447 // Notify the JavaScript engine in the render to change its parameters |
| 505 // while performing stress testing. | 448 // while performing stress testing. |
| 506 IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, | 449 IPC_MESSAGE_ROUTED2(ViewMsg_JavaScriptStressTestControl, |
| 507 int /* cmd */, | 450 int /* cmd */, |
| 508 int /* param */) | 451 int /* param */) |
| 509 | |
| 510 // Register a new handler for URL requests with the given scheme. | |
| 511 IPC_MESSAGE_ROUTED3(ViewHostMsg_RegisterProtocolHandler, | |
| 512 std::string /* scheme */, | |
| 513 GURL /* url */, | |
| 514 string16 /* title */) | |
| OLD | NEW |