| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 6 #include <stdint.h> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.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/instant_types.h" | 21 #include "chrome/common/instant_types.h" |
| 22 #include "chrome/common/ntp_logging_events.h" | 22 #include "chrome/common/ntp_logging_events.h" |
| 23 #include "chrome/common/omnibox_focus_state.h" | 23 #include "chrome/common/omnibox_focus_state.h" |
| 24 #include "chrome/common/search_provider.h" | 24 #include "chrome/common/search_provider.h" |
| 25 #include "chrome/common/web_application_info.h" | 25 #include "chrome/common/web_application_info.h" |
| 26 #include "components/content_settings/core/common/content_settings.h" | 26 #include "components/content_settings/core/common/content_settings.h" |
| 27 #include "components/content_settings/core/common/content_settings_pattern.h" | 27 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 28 #include "components/content_settings/core/common/content_settings_types.h" | |
| 29 #include "components/nacl/common/nacl_types.h" | 28 #include "components/nacl/common/nacl_types.h" |
| 30 #include "content/public/common/common_param_traits.h" | 29 #include "content/public/common/common_param_traits.h" |
| 31 #include "content/public/common/referrer.h" | 30 #include "content/public/common/referrer.h" |
| 32 #include "content/public/common/top_controls_state.h" | 31 #include "content/public/common/top_controls_state.h" |
| 33 #include "ipc/ipc_channel_handle.h" | 32 #include "ipc/ipc_channel_handle.h" |
| 34 #include "ipc/ipc_message_macros.h" | 33 #include "ipc/ipc_message_macros.h" |
| 35 #include "ipc/ipc_platform_file.h" | 34 #include "ipc/ipc_platform_file.h" |
| 36 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerProm
ptReply.h" | 35 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerProm
ptReply.h" |
| 37 #include "third_party/WebKit/public/web/WebCache.h" | 36 #include "third_party/WebKit/public/web/WebCache.h" |
| 38 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 37 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // which is late enough to not be thrown out, and early enough to be before | 217 // which is late enough to not be thrown out, and early enough to be before |
| 219 // onload events are fired. | 218 // onload events are fired. |
| 220 IPC_MESSAGE_ROUTED1(ChromeViewMsg_WebUIJavaScript, | 219 IPC_MESSAGE_ROUTED1(ChromeViewMsg_WebUIJavaScript, |
| 221 base::string16 /* javascript */) | 220 base::string16 /* javascript */) |
| 222 #endif | 221 #endif |
| 223 | 222 |
| 224 // Set the content setting rules stored by the renderer. | 223 // Set the content setting rules stored by the renderer. |
| 225 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetContentSettingRules, | 224 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetContentSettingRules, |
| 226 RendererContentSettingRules /* rules */) | 225 RendererContentSettingRules /* rules */) |
| 227 | 226 |
| 228 // Tells the render frame to load all blocked plugins with the given identifier. | |
| 229 IPC_MESSAGE_ROUTED1(ChromeViewMsg_LoadBlockedPlugins, | |
| 230 std::string /* identifier */) | |
| 231 | |
| 232 // Asks the renderer to send back stats on the WebCore cache broken down by | 227 // Asks the renderer to send back stats on the WebCore cache broken down by |
| 233 // resource types. | 228 // resource types. |
| 234 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetCacheResourceStats) | 229 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetCacheResourceStats) |
| 235 | 230 |
| 236 // Tells the renderer to create a FieldTrial, and by using a 100% probability | 231 // Tells the renderer to create a FieldTrial, and by using a 100% probability |
| 237 // for the FieldTrial, forces the FieldTrial to have assigned group name. | 232 // for the FieldTrial, forces the FieldTrial to have assigned group name. |
| 238 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetFieldTrialGroup, | 233 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetFieldTrialGroup, |
| 239 std::string /* field trial name */, | 234 std::string /* field trial name */, |
| 240 std::string /* group name that was assigned. */) | 235 std::string /* group name that was assigned. */) |
| 241 | 236 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 base::string16 /* identity */, | 277 base::string16 /* identity */, |
| 283 bool /* identity_match */) | 278 bool /* identity_match */) |
| 284 | 279 |
| 285 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch) | 280 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch) |
| 286 | 281 |
| 287 // Sent on process startup to indicate whether this process is running in | 282 // Sent on process startup to indicate whether this process is running in |
| 288 // incognito mode. | 283 // incognito mode. |
| 289 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess, | 284 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess, |
| 290 bool /* is_incognito_processs */) | 285 bool /* is_incognito_processs */) |
| 291 | 286 |
| 292 // Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent. | |
| 293 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent, | |
| 294 bool /* allowed */) | |
| 295 | |
| 296 // Sent in response to ViewHostMsg_DidBlockRunningInsecureContent. | |
| 297 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowRunningInsecureContent, | |
| 298 bool /* allowed */) | |
| 299 | |
| 300 IPC_MESSAGE_ROUTED0(ChromeViewMsg_ReloadFrame) | |
| 301 | |
| 302 // Tells the renderer whether or not a file system access has been allowed. | |
| 303 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestFileSystemAccessAsyncResponse, | |
| 304 int /* request_id */, | |
| 305 bool /* allowed */) | |
| 306 | |
| 307 // Sent when the profile changes the kSafeBrowsingEnabled preference. | 287 // Sent when the profile changes the kSafeBrowsingEnabled preference. |
| 308 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetClientSidePhishingDetection, | 288 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetClientSidePhishingDetection, |
| 309 bool /* enable_phishing_detection */) | 289 bool /* enable_phishing_detection */) |
| 310 | 290 |
| 311 // Asks the renderer for a thumbnail of the image selected by the most | 291 // Asks the renderer for a thumbnail of the image selected by the most |
| 312 // recently opened context menu, if there is one. If the image's area | 292 // recently opened context menu, if there is one. If the image's area |
| 313 // is greater than thumbnail_min_area it will be downscaled to | 293 // is greater than thumbnail_min_area it will be downscaled to |
| 314 // be within thumbnail_max_size. The possibly downsampled image will be | 294 // be within thumbnail_max_size. The possibly downsampled image will be |
| 315 // returned in a ChromeViewHostMsg_RequestThumbnailForContextNode_ACK message. | 295 // returned in a ChromeViewHostMsg_RequestThumbnailForContextNode_ACK message. |
| 316 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestThumbnailForContextNode, | 296 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestThumbnailForContextNode, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts, | 334 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts, |
| 355 GURL /* current URL */, | 335 GURL /* current URL */, |
| 356 std::vector<std::string> /* managed accounts */) | 336 std::vector<std::string> /* managed accounts */) |
| 357 | 337 |
| 358 // Message sent from the renderer to the browser to show the browser account | 338 // Message sent from the renderer to the browser to show the browser account |
| 359 // management UI. | 339 // management UI. |
| 360 IPC_MESSAGE_CONTROL0(ChromeViewHostMsg_ShowBrowserAccountManagementUI) | 340 IPC_MESSAGE_CONTROL0(ChromeViewHostMsg_ShowBrowserAccountManagementUI) |
| 361 | 341 |
| 362 // JavaScript related messages ----------------------------------------------- | 342 // JavaScript related messages ----------------------------------------------- |
| 363 | 343 |
| 364 // Tells the frame it is displaying an interstitial page. | |
| 365 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SetAsInterstitial) | |
| 366 | |
| 367 // Provides the renderer with the results of the browser's investigation into | 344 // Provides the renderer with the results of the browser's investigation into |
| 368 // why a recent main frame load failed (currently, just DNS probe result). | 345 // why a recent main frame load failed (currently, just DNS probe result). |
| 369 // NetErrorHelper will receive this mesage and replace or update the error | 346 // NetErrorHelper will receive this mesage and replace or update the error |
| 370 // page with more specific troubleshooting suggestions. | 347 // page with more specific troubleshooting suggestions. |
| 371 IPC_MESSAGE_ROUTED1(ChromeViewMsg_NetErrorInfo, | 348 IPC_MESSAGE_ROUTED1(ChromeViewMsg_NetErrorInfo, |
| 372 int /* DNS probe status */) | 349 int /* DNS probe status */) |
| 373 | 350 |
| 374 // Provides the information needed by the renderer process to contact a | 351 // Provides the information needed by the renderer process to contact a |
| 375 // navigation correction service. Handled by the NetErrorHelper. | 352 // navigation correction service. Handled by the NetErrorHelper. |
| 376 IPC_MESSAGE_ROUTED5(ChromeViewMsg_SetNavigationCorrectionInfo, | 353 IPC_MESSAGE_ROUTED5(ChromeViewMsg_SetNavigationCorrectionInfo, |
| 377 GURL /* Navigation correction service base URL */, | 354 GURL /* Navigation correction service base URL */, |
| 378 std::string /* language */, | 355 std::string /* language */, |
| 379 std::string /* origin_country */, | 356 std::string /* origin_country */, |
| 380 std::string /* API key to use */, | 357 std::string /* API key to use */, |
| 381 GURL /* Google Search URL to use */) | 358 GURL /* Google Search URL to use */) |
| 382 | 359 |
| 383 //----------------------------------------------------------------------------- | 360 //----------------------------------------------------------------------------- |
| 384 // Misc messages | 361 // Misc messages |
| 385 // These are messages sent from the renderer to the browser process. | 362 // These are messages sent from the renderer to the browser process. |
| 386 | 363 |
| 387 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats, | 364 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats, |
| 388 blink::WebCache::UsageStats /* stats */) | 365 blink::WebCache::UsageStats /* stats */) |
| 389 | 366 |
| 390 // Tells the browser that content in the current page was blocked due to the | |
| 391 // user's content settings. | |
| 392 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_ContentBlocked, | |
| 393 ContentSettingsType /* type of blocked content */, | |
| 394 base::string16 /* details on blocked content */) | |
| 395 | |
| 396 // Sent by the renderer process to check whether access to web databases is | |
| 397 // granted by content settings. | |
| 398 IPC_SYNC_MESSAGE_CONTROL5_1(ChromeViewHostMsg_AllowDatabase, | |
| 399 int /* render_frame_id */, | |
| 400 GURL /* origin_url */, | |
| 401 GURL /* top origin url */, | |
| 402 base::string16 /* database name */, | |
| 403 base::string16 /* database display name */, | |
| 404 bool /* allowed */) | |
| 405 | |
| 406 // Sent by the renderer process to check whether access to DOM Storage is | |
| 407 // granted by content settings. | |
| 408 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowDOMStorage, | |
| 409 int /* render_frame_id */, | |
| 410 GURL /* origin_url */, | |
| 411 GURL /* top origin url */, | |
| 412 bool /* if true local storage, otherwise session */, | |
| 413 bool /* allowed */) | |
| 414 | |
| 415 // Sent by the renderer process to check whether access to FileSystem is | 367 // Sent by the renderer process to check whether access to FileSystem is |
| 416 // granted by content settings. | 368 // granted by content settings. |
| 417 IPC_SYNC_MESSAGE_CONTROL3_1(ChromeViewHostMsg_RequestFileSystemAccessSync, | 369 IPC_SYNC_MESSAGE_CONTROL3_1(ChromeViewHostMsg_RequestFileSystemAccessSync, |
| 418 int /* render_frame_id */, | 370 int /* render_frame_id */, |
| 419 GURL /* origin_url */, | 371 GURL /* origin_url */, |
| 420 GURL /* top origin url */, | 372 GURL /* top origin url */, |
| 421 bool /* allowed */) | 373 bool /* allowed */) |
| 422 | 374 |
| 423 // Sent by the renderer process to check whether access to FileSystem is | |
| 424 // granted by content settings. | |
| 425 IPC_MESSAGE_CONTROL4(ChromeViewHostMsg_RequestFileSystemAccessAsync, | |
| 426 int /* render_frame_id */, | |
| 427 int /* request_id */, | |
| 428 GURL /* origin_url */, | |
| 429 GURL /* top origin url */) | |
| 430 | |
| 431 // Sent by the renderer process to check whether access to Indexed DBis | |
| 432 // granted by content settings. | |
| 433 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowIndexedDB, | |
| 434 int /* render_frame_id */, | |
| 435 GURL /* origin_url */, | |
| 436 GURL /* top origin url */, | |
| 437 base::string16 /* database name */, | |
| 438 bool /* allowed */) | |
| 439 | |
| 440 // Return information about a plugin for the given URL and MIME type. | 375 // Return information about a plugin for the given URL and MIME type. |
| 441 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows | 376 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows |
| 442 // about specific reasons why a plugin can't be used, for example because it's | 377 // about specific reasons why a plugin can't be used, for example because it's |
| 443 // disabled. | 378 // disabled. |
| 444 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_GetPluginInfo, | 379 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_GetPluginInfo, |
| 445 int /* render_frame_id */, | 380 int /* render_frame_id */, |
| 446 GURL /* url */, | 381 GURL /* url */, |
| 447 GURL /* top origin url */, | 382 GURL /* top origin url */, |
| 448 std::string /* mime_type */, | 383 std::string /* mime_type */, |
| 449 ChromeViewHostMsg_GetPluginInfo_Output /* output */) | 384 ChromeViewHostMsg_GetPluginInfo_Output /* output */) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // Tells the browser that we blocked a plugin because NPAPI is not supported. | 442 // Tells the browser that we blocked a plugin because NPAPI is not supported. |
| 508 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_NPAPINotSupported, | 443 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_NPAPINotSupported, |
| 509 std::string /* identifer */) | 444 std::string /* identifer */) |
| 510 | 445 |
| 511 // Asks the renderer whether an app banner should be shown. It will reply with | 446 // Asks the renderer whether an app banner should be shown. It will reply with |
| 512 // ChromeViewHostMsg_AppBannerPromptReply. | 447 // ChromeViewHostMsg_AppBannerPromptReply. |
| 513 IPC_MESSAGE_ROUTED2(ChromeViewMsg_AppBannerPromptRequest, | 448 IPC_MESSAGE_ROUTED2(ChromeViewMsg_AppBannerPromptRequest, |
| 514 int /* request_id */, | 449 int /* request_id */, |
| 515 std::string /* platform */) | 450 std::string /* platform */) |
| 516 | 451 |
| 517 // Tells the renderer that the NPAPI cannot be used. For example Ash on windows. | |
| 518 IPC_MESSAGE_ROUTED0(ChromeViewMsg_NPAPINotSupported) | |
| 519 | |
| 520 // Notification that the page has an OpenSearch description document | 452 // Notification that the page has an OpenSearch description document |
| 521 // associated with it. | 453 // associated with it. |
| 522 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD, | 454 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD, |
| 523 GURL /* page_url */, | 455 GURL /* page_url */, |
| 524 GURL /* osdd_url */, | 456 GURL /* osdd_url */, |
| 525 search_provider::OSDDType) | 457 search_provider::OSDDType) |
| 526 | 458 |
| 527 // Find out if the given url's security origin is installed as a search | 459 // Find out if the given url's security origin is installed as a search |
| 528 // provider. | 460 // provider. |
| 529 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetSearchProviderInstallState, | 461 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetSearchProviderInstallState, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 550 // Provide the browser process with information about the WebCore resource | 482 // Provide the browser process with information about the WebCore resource |
| 551 // cache and current renderer framerate. | 483 // cache and current renderer framerate. |
| 552 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats, | 484 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats, |
| 553 blink::WebCache::ResourceTypeStats) | 485 blink::WebCache::ResourceTypeStats) |
| 554 | 486 |
| 555 // Message sent from the renderer to the browser to notify it of a | 487 // Message sent from the renderer to the browser to notify it of a |
| 556 // window.print() call which should cancel the prerender. The message is sent | 488 // window.print() call which should cancel the prerender. The message is sent |
| 557 // only when the renderer is prerendering. | 489 // only when the renderer is prerendering. |
| 558 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting) | 490 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting) |
| 559 | 491 |
| 560 // Sent when the renderer was prevented from displaying insecure content in | |
| 561 // a secure page by a security policy. The page may appear incomplete. | |
| 562 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockDisplayingInsecureContent) | |
| 563 | |
| 564 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_DidGetWebApplicationInfo, | 492 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_DidGetWebApplicationInfo, |
| 565 WebApplicationInfo) | 493 WebApplicationInfo) |
| 566 | 494 |
| 567 #if defined(OS_ANDROID) | 495 #if defined(OS_ANDROID) |
| 568 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveMetaTagContent, | 496 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveMetaTagContent, |
| 569 bool /* success */, | 497 bool /* success */, |
| 570 std::string /* tag_name */, | 498 std::string /* tag_name */, |
| 571 std::string /* tag_content */, | 499 std::string /* tag_content */, |
| 572 GURL /* expected_url */) | 500 GURL /* expected_url */) |
| 573 #endif // defined(OS_ANDROID) | 501 #endif // defined(OS_ANDROID) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 588 |
| 661 // Tells the browser process whether the web page wants the banner to be shown. | 589 // Tells the browser process whether the web page wants the banner to be shown. |
| 662 // This is a reply from ChromeViewMsg_AppBannerPromptRequest. | 590 // This is a reply from ChromeViewMsg_AppBannerPromptRequest. |
| 663 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_AppBannerPromptReply, | 591 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_AppBannerPromptReply, |
| 664 int /* request_id */, | 592 int /* request_id */, |
| 665 blink::WebAppBannerPromptReply /* reply */) | 593 blink::WebAppBannerPromptReply /* reply */) |
| 666 | 594 |
| 667 // Sent by the renderer to indicate that a fields trial has been activated. | 595 // Sent by the renderer to indicate that a fields trial has been activated. |
| 668 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_FieldTrialActivated, | 596 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_FieldTrialActivated, |
| 669 std::string /* name */) | 597 std::string /* name */) |
| OLD | NEW |