11813ce775dd064ca4002a98852ce7f02d89f25b
[platform/framework/web/crosswalk.git] / src / chrome / common / render_messages.h
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
3 // found in the LICENSE file.
4
5 // Multiply-included file, no traditional include guard.
6 #include <stdint.h>
7 #include <map>
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 #include "base/files/file_path.h"
13 #include "base/memory/shared_memory.h"
14 #include "base/process/process.h"
15 #include "base/strings/string16.h"
16 #include "base/strings/stringprintf.h"
17 #include "base/values.h"
18 #include "build/build_config.h"
19 #include "chrome/common/autocomplete_match_type.h"
20 #include "chrome/common/common_param_traits.h"
21 #include "chrome/common/content_settings.h"
22 #include "chrome/common/content_settings_pattern.h"
23 #include "chrome/common/instant_types.h"
24 #include "chrome/common/ntp_logging_events.h"
25 #include "chrome/common/omnibox_focus_state.h"
26 #include "chrome/common/search_provider.h"
27 #include "components/nacl/common/nacl_types.h"
28 #include "components/translate/core/common/language_detection_details.h"
29 #include "components/translate/core/common/translate_errors.h"
30 #include "content/public/common/common_param_traits.h"
31 #include "content/public/common/referrer.h"
32 #include "content/public/common/top_controls_state.h"
33 #include "extensions/common/stack_frame.h"
34 #include "ipc/ipc_channel_handle.h"
35 #include "ipc/ipc_message_macros.h"
36 #include "ipc/ipc_platform_file.h"
37 #include "third_party/skia/include/core/SkBitmap.h"
38 #include "third_party/WebKit/public/web/WebCache.h"
39 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
40 #include "ui/base/window_open_disposition.h"
41 #include "ui/gfx/rect.h"
42
43 // Singly-included section for enums and custom IPC traits.
44 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_
45 #define CHROME_COMMON_RENDER_MESSAGES_H_
46
47 class SkBitmap;
48
49 // Command values for the cmd parameter of the
50 // ChromeViewMsg_JavaScriptStressTestControl message. For each command the
51 // parameter passed has a different meaning:
52 // For the command kJavaScriptStressTestSetStressRunType the parameter it the
53 // type taken from the enumeration v8::Testing::StressType.
54 // For the command kJavaScriptStressTestPrepareStressRun the parameter it the
55 // number of the stress run about to take place.
56 enum ViewHostMsg_JavaScriptStressTestControl_Commands {
57   kJavaScriptStressTestSetStressRunType = 0,
58   kJavaScriptStressTestPrepareStressRun = 1,
59 };
60
61 // This enum is inside a struct so that we can forward-declare the struct in
62 // others headers without having to include this one.
63 struct ChromeViewHostMsg_GetPluginInfo_Status {
64   enum Value {
65     kAllowed,
66     kBlocked,
67     kBlockedByPolicy,
68     kClickToPlay,
69     kDisabled,
70     kNotFound,
71     kNPAPINotSupported,
72     kOutdatedBlocked,
73     kOutdatedDisallowed,
74     kUnauthorized,
75   };
76
77   ChromeViewHostMsg_GetPluginInfo_Status() : value(kAllowed) {}
78
79   Value value;
80 };
81
82 namespace IPC {
83
84 #if defined(OS_POSIX) && !defined(USE_AURA) && !defined(OS_ANDROID)
85
86 // TODO(port): this shouldn't exist. However, the plugin stuff is really using
87 // HWNDS (NativeView), and making Windows calls based on them. I've not figured
88 // out the deal with plugins yet.
89 // TODO(android): a gfx::NativeView is the same as a gfx::NativeWindow.
90 template <>
91 struct ParamTraits<gfx::NativeView> {
92   typedef gfx::NativeView param_type;
93   static void Write(Message* m, const param_type& p) {
94     NOTIMPLEMENTED();
95   }
96
97   static bool Read(const Message* m, PickleIterator* iter, param_type* p) {
98     NOTIMPLEMENTED();
99     *p = NULL;
100     return true;
101   }
102
103   static void Log(const param_type& p, std::string* l) {
104     l->append(base::StringPrintf("<gfx::NativeView>"));
105   }
106 };
107
108 #endif  // defined(OS_POSIX) && !defined(USE_AURA) && !defined(OS_ANDROID)
109
110 template <>
111 struct ParamTraits<ContentSettingsPattern> {
112   typedef ContentSettingsPattern param_type;
113   static void Write(Message* m, const param_type& p);
114   static bool Read(const Message* m, PickleIterator* iter, param_type* r);
115   static void Log(const param_type& p, std::string* l);
116 };
117
118 }  // namespace IPC
119
120 #endif  // CHROME_COMMON_RENDER_MESSAGES_H_
121
122 #define IPC_MESSAGE_START ChromeMsgStart
123
124 IPC_ENUM_TRAITS_MAX_VALUE(ChromeViewHostMsg_GetPluginInfo_Status::Value,
125                           ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized)
126 IPC_ENUM_TRAITS(OmniboxFocusChangeReason)
127 IPC_ENUM_TRAITS(OmniboxFocusState)
128 IPC_ENUM_TRAITS(search_provider::OSDDType)
129 IPC_ENUM_TRAITS(search_provider::InstallState)
130 IPC_ENUM_TRAITS(ThemeBackgroundImageAlignment)
131 IPC_ENUM_TRAITS(ThemeBackgroundImageTiling)
132 IPC_ENUM_TRAITS(TranslateErrors::Type)
133 IPC_ENUM_TRAITS(blink::WebConsoleMessage::Level)
134 IPC_ENUM_TRAITS(content::TopControlsState)
135
136 IPC_STRUCT_TRAITS_BEGIN(ChromeViewHostMsg_GetPluginInfo_Status)
137 IPC_STRUCT_TRAITS_MEMBER(value)
138 IPC_STRUCT_TRAITS_END()
139
140 // Output parameters for ChromeViewHostMsg_GetPluginInfo message.
141 IPC_STRUCT_BEGIN(ChromeViewHostMsg_GetPluginInfo_Output)
142   IPC_STRUCT_MEMBER(ChromeViewHostMsg_GetPluginInfo_Status, status)
143   IPC_STRUCT_MEMBER(content::WebPluginInfo, plugin)
144   IPC_STRUCT_MEMBER(std::string, actual_mime_type)
145   IPC_STRUCT_MEMBER(std::string, group_identifier)
146   IPC_STRUCT_MEMBER(base::string16, group_name)
147 IPC_STRUCT_END()
148
149 IPC_STRUCT_TRAITS_BEGIN(ContentSettingsPattern::PatternParts)
150   IPC_STRUCT_TRAITS_MEMBER(scheme)
151   IPC_STRUCT_TRAITS_MEMBER(is_scheme_wildcard)
152   IPC_STRUCT_TRAITS_MEMBER(host)
153   IPC_STRUCT_TRAITS_MEMBER(has_domain_wildcard)
154   IPC_STRUCT_TRAITS_MEMBER(port)
155   IPC_STRUCT_TRAITS_MEMBER(is_port_wildcard)
156   IPC_STRUCT_TRAITS_MEMBER(path)
157   IPC_STRUCT_TRAITS_MEMBER(is_path_wildcard)
158 IPC_STRUCT_TRAITS_END()
159
160 IPC_STRUCT_TRAITS_BEGIN(ContentSettingPatternSource)
161   IPC_STRUCT_TRAITS_MEMBER(primary_pattern)
162   IPC_STRUCT_TRAITS_MEMBER(secondary_pattern)
163   IPC_STRUCT_TRAITS_MEMBER(setting)
164   IPC_STRUCT_TRAITS_MEMBER(source)
165   IPC_STRUCT_TRAITS_MEMBER(incognito)
166 IPC_STRUCT_TRAITS_END()
167
168 IPC_STRUCT_TRAITS_BEGIN(InstantSuggestion)
169   IPC_STRUCT_TRAITS_MEMBER(text)
170   IPC_STRUCT_TRAITS_MEMBER(metadata)
171 IPC_STRUCT_TRAITS_END()
172
173 IPC_STRUCT_TRAITS_BEGIN(InstantMostVisitedItem)
174   IPC_STRUCT_TRAITS_MEMBER(url)
175   IPC_STRUCT_TRAITS_MEMBER(title)
176 IPC_STRUCT_TRAITS_END()
177
178 IPC_STRUCT_TRAITS_BEGIN(RendererContentSettingRules)
179   IPC_STRUCT_TRAITS_MEMBER(image_rules)
180   IPC_STRUCT_TRAITS_MEMBER(script_rules)
181 IPC_STRUCT_TRAITS_END()
182
183 IPC_STRUCT_TRAITS_BEGIN(RGBAColor)
184   IPC_STRUCT_TRAITS_MEMBER(r)
185   IPC_STRUCT_TRAITS_MEMBER(g)
186   IPC_STRUCT_TRAITS_MEMBER(b)
187   IPC_STRUCT_TRAITS_MEMBER(a)
188 IPC_STRUCT_TRAITS_END()
189
190 IPC_STRUCT_TRAITS_BEGIN(ThemeBackgroundInfo)
191   IPC_STRUCT_TRAITS_MEMBER(using_default_theme)
192   IPC_STRUCT_TRAITS_MEMBER(background_color)
193   IPC_STRUCT_TRAITS_MEMBER(text_color)
194   IPC_STRUCT_TRAITS_MEMBER(link_color)
195   IPC_STRUCT_TRAITS_MEMBER(text_color_light)
196   IPC_STRUCT_TRAITS_MEMBER(header_color)
197   IPC_STRUCT_TRAITS_MEMBER(section_border_color)
198   IPC_STRUCT_TRAITS_MEMBER(theme_id)
199   IPC_STRUCT_TRAITS_MEMBER(image_horizontal_alignment)
200   IPC_STRUCT_TRAITS_MEMBER(image_vertical_alignment)
201   IPC_STRUCT_TRAITS_MEMBER(image_tiling)
202   IPC_STRUCT_TRAITS_MEMBER(image_height)
203   IPC_STRUCT_TRAITS_MEMBER(has_attribution)
204   IPC_STRUCT_TRAITS_MEMBER(logo_alternate)
205 IPC_STRUCT_TRAITS_END()
206
207 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::ResourceTypeStat)
208   IPC_STRUCT_TRAITS_MEMBER(count)
209   IPC_STRUCT_TRAITS_MEMBER(size)
210   IPC_STRUCT_TRAITS_MEMBER(liveSize)
211   IPC_STRUCT_TRAITS_MEMBER(decodedSize)
212 IPC_STRUCT_TRAITS_END()
213
214 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::ResourceTypeStats)
215   IPC_STRUCT_TRAITS_MEMBER(images)
216   IPC_STRUCT_TRAITS_MEMBER(cssStyleSheets)
217   IPC_STRUCT_TRAITS_MEMBER(scripts)
218   IPC_STRUCT_TRAITS_MEMBER(xslStyleSheets)
219   IPC_STRUCT_TRAITS_MEMBER(fonts)
220 IPC_STRUCT_TRAITS_END()
221
222 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::UsageStats)
223   IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity)
224   IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity)
225   IPC_STRUCT_TRAITS_MEMBER(capacity)
226   IPC_STRUCT_TRAITS_MEMBER(liveSize)
227   IPC_STRUCT_TRAITS_MEMBER(deadSize)
228 IPC_STRUCT_TRAITS_END()
229
230 IPC_STRUCT_TRAITS_BEGIN(LanguageDetectionDetails)
231   IPC_STRUCT_TRAITS_MEMBER(time)
232   IPC_STRUCT_TRAITS_MEMBER(url)
233   IPC_STRUCT_TRAITS_MEMBER(content_language)
234   IPC_STRUCT_TRAITS_MEMBER(cld_language)
235   IPC_STRUCT_TRAITS_MEMBER(is_cld_reliable)
236   IPC_STRUCT_TRAITS_MEMBER(html_root_language)
237   IPC_STRUCT_TRAITS_MEMBER(adopted_language)
238   IPC_STRUCT_TRAITS_MEMBER(contents)
239 IPC_STRUCT_TRAITS_END()
240
241 IPC_STRUCT_TRAITS_BEGIN(extensions::StackFrame)
242   IPC_STRUCT_TRAITS_MEMBER(line_number)
243   IPC_STRUCT_TRAITS_MEMBER(column_number)
244   IPC_STRUCT_TRAITS_MEMBER(source)
245   IPC_STRUCT_TRAITS_MEMBER(function)
246 IPC_STRUCT_TRAITS_END()
247
248 IPC_ENUM_TRAITS_MAX_VALUE(NTPLoggingEventType,
249                           NTP_NUM_EVENT_TYPES)
250
251 //-----------------------------------------------------------------------------
252 // RenderView messages
253 // These are messages sent from the browser to the renderer process.
254
255 // Tells the renderer to set its maximum cache size to the supplied value.
256 IPC_MESSAGE_CONTROL3(ChromeViewMsg_SetCacheCapacities,
257                      size_t /* min_dead_capacity */,
258                      size_t /* max_dead_capacity */,
259                      size_t /* capacity */)
260
261 // Tells the renderer to clear the cache.
262 IPC_MESSAGE_CONTROL1(ChromeViewMsg_ClearCache,
263                      bool /* on_navigation */)
264
265 // For WebUI testing, this message requests JavaScript to be executed at a time
266 // which is late enough to not be thrown out, and early enough to be before
267 // onload events are fired.
268 IPC_MESSAGE_ROUTED1(ChromeViewMsg_WebUIJavaScript,
269                     base::string16  /* javascript */)
270
271 // Set the content setting rules stored by the renderer.
272 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetContentSettingRules,
273                      RendererContentSettingRules /* rules */)
274
275 // Tells the render frame to load all blocked plugins with the given identifier.
276 IPC_MESSAGE_ROUTED1(ChromeViewMsg_LoadBlockedPlugins,
277                     std::string /* identifier */)
278
279 // Asks the renderer to send back stats on the WebCore cache broken down by
280 // resource types.
281 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetCacheResourceStats)
282
283 // Tells the renderer to create a FieldTrial, and by using a 100% probability
284 // for the FieldTrial, forces the FieldTrial to have assigned group name.
285 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetFieldTrialGroup,
286                      std::string /* field trial name */,
287                      std::string /* group name that was assigned. */)
288
289 // Asks the renderer to send back V8 heap stats.
290 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetV8HeapStats)
291
292 IPC_MESSAGE_ROUTED0(ChromeViewMsg_DetermineIfPageSupportsInstant)
293
294 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetDisplayInstantResults,
295                     bool /* display_instant_results */)
296
297 IPC_MESSAGE_ROUTED2(ChromeViewMsg_SearchBoxFocusChanged,
298                     OmniboxFocusState /* new_focus_state */,
299                     OmniboxFocusChangeReason /* reason */)
300
301 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMarginChange, int /* start */)
302
303 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMostVisitedItemsChanged,
304                     std::vector<InstantMostVisitedItem> /* items */)
305
306 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxPromoInformation,
307                     bool /* is_app_launcher_enabled */)
308
309 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetInputInProgress,
310                     bool /* input_in_progress */)
311
312 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetSuggestionToPrefetch,
313                     InstantSuggestion /* suggestion */)
314
315 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSubmit,
316                     base::string16 /* value */)
317
318 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxThemeChanged,
319                     ThemeBackgroundInfo /* value */)
320
321 IPC_MESSAGE_ROUTED2(ChromeViewMsg_ChromeIdentityCheckResult,
322                     base::string16 /* identity */,
323                     bool /* identity_match */)
324
325 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch)
326
327 // Toggles visual muting of the render view area. This is on when a constrained
328 // window is showing.
329 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized,
330                     bool /* deemphazied */)
331
332 // Tells the renderer to translate the page contents from one language to
333 // another.
334 IPC_MESSAGE_ROUTED4(ChromeViewMsg_TranslatePage,
335                     int /* page id */,
336                     std::string, /* the script injected in the page */
337                     std::string, /* BCP 47/RFC 5646 language code the page
338                                     is in */
339                     std::string /* BCP 47/RFC 5646 language code to translate
340                                    to */)
341
342 // Tells the renderer to revert the text of translated page to its original
343 // contents.
344 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RevertTranslation,
345                     int /* page id */)
346
347 // Sent on process startup to indicate whether this process is running in
348 // incognito mode.
349 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess,
350                      bool /* is_incognito_processs */)
351
352 // Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent.
353 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent,
354                     bool /* allowed */)
355
356 // Sent in response to ViewHostMsg_DidBlockRunningInsecureContent.
357 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowRunningInsecureContent,
358                     bool /* allowed */)
359
360 IPC_MESSAGE_ROUTED0(ChromeViewMsg_ReloadFrame)
361
362 // Sent when the profile changes the kSafeBrowsingEnabled preference.
363 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetClientSidePhishingDetection,
364                     bool /* enable_phishing_detection */)
365
366 // Asks the renderer for a thumbnail of the image selected by the most
367 // recently opened context menu, if there is one. If the image's area
368 // is greater than thumbnail_min_area it will be downscaled to
369 // be within thumbnail_max_size. The possibly downsampled image will be
370 // returned in a ChromeViewHostMsg_RequestThumbnailForContextNode_ACK message.
371 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestThumbnailForContextNode,
372                     int /* thumbnail_min_area_pixels */,
373                     gfx::Size /* thumbnail_max_size_pixels */)
374
375 // Notifies the renderer whether hiding/showing the top controls is enabled,
376 // what the current state should be, and whether or not to animate to the
377 // proper state.
378 IPC_MESSAGE_ROUTED3(ChromeViewMsg_UpdateTopControlsState,
379                     content::TopControlsState /* constraints */,
380                     content::TopControlsState /* current */,
381                     bool /* animate */)
382
383
384 // Updates the window features of the render view.
385 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetWindowFeatures,
386                     blink::WebWindowFeatures /* window_features */)
387
388 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_RequestThumbnailForContextNode_ACK,
389                     SkBitmap /* thumbnail */,
390                     gfx::Size /* original size of the image */)
391
392 #if defined(OS_ANDROID)
393 // Asks the renderer to return information about whether the current page can
394 // be treated as a webapp.
395 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RetrieveWebappInformation,
396                     GURL /* expected_url */)
397
398 // Asks the renderer to return information about the given meta tag.
399 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RetrieveMetaTagContent,
400                     GURL /* expected_url */,
401                     std::string /* tag_name */ )
402 #endif  // defined(OS_ANDROID)
403
404 #if defined(CLD2_DYNAMIC_MODE)
405 // Informs the renderer process that Compact Language Detector (CLD) data is
406 // available and provides an IPC::PlatformFileForTransit obtained from
407 // IPC::GetFileHandleForProcess(...)
408 // See also: ChromeViewHostMsg_NeedCLDData
409 IPC_MESSAGE_ROUTED3(ChromeViewMsg_CLDDataAvailable,
410                     IPC::PlatformFileForTransit /* ipc_file_handle */,
411                     uint64 /* data_offset */,
412                     uint64 /* data_length */)
413 #endif
414
415 // chrome.principals messages ------------------------------------------------
416
417 // Message sent from the renderer to the browser to get the list of browser
418 // managed accounts for the given origin.
419 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts,
420                             GURL /* current URL */,
421                             std::vector<std::string> /* managed accounts */)
422
423 // Message sent from the renderer to the browser to show the browser account
424 // management UI.
425 IPC_MESSAGE_CONTROL0(ChromeViewHostMsg_ShowBrowserAccountManagementUI)
426
427 // JavaScript related messages -----------------------------------------------
428
429 // Notify the JavaScript engine in the render to change its parameters
430 // while performing stress testing.
431 IPC_MESSAGE_ROUTED2(ChromeViewMsg_JavaScriptStressTestControl,
432                     int /* cmd */,
433                     int /* param */)
434
435 // Asks the renderer to send back FPS.
436 IPC_MESSAGE_ROUTED0(ChromeViewMsg_GetFPS)
437
438 // Tells the frame it is displaying an interstitial page.
439 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SetAsInterstitial)
440
441 // Provides the renderer with the results of the browser's investigation into
442 // why a recent main frame load failed (currently, just DNS probe result).
443 // NetErrorHelper will receive this mesage and replace or update the error
444 // page with more specific troubleshooting suggestions.
445 IPC_MESSAGE_ROUTED1(ChromeViewMsg_NetErrorInfo,
446                     int /* DNS probe status */)
447
448 // Provides the information needed by the renderer process to contact a
449 // navigation correction service.  Handled by the NetErrorHelper.
450 IPC_MESSAGE_ROUTED5(ChromeViewMsg_SetNavigationCorrectionInfo,
451                     GURL /* Navigation correction service base URL */,
452                     std::string /* language */,
453                     std::string /* origin_country */,
454                     std::string /* API key to use */,
455                     GURL /* Google Search URL to use */)
456
457 //-----------------------------------------------------------------------------
458 // Misc messages
459 // These are messages sent from the renderer to the browser process.
460
461 // Notification that the language for the tab has been determined.
462 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_TranslateLanguageDetermined,
463                     LanguageDetectionDetails /* details about lang detection */,
464                     bool /* whether the page needs translation */)
465
466 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats,
467                      blink::WebCache::UsageStats /* stats */)
468
469 // Tells the browser that content in the current page was blocked due to the
470 // user's content settings.
471 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_ContentBlocked,
472                     ContentSettingsType /* type of blocked content */)
473
474 // Sent by the renderer process to check whether access to web databases is
475 // granted by content settings.
476 IPC_SYNC_MESSAGE_CONTROL5_1(ChromeViewHostMsg_AllowDatabase,
477                             int /* render_frame_id */,
478                             GURL /* origin_url */,
479                             GURL /* top origin url */,
480                             base::string16 /* database name */,
481                             base::string16 /* database display name */,
482                             bool /* allowed */)
483
484 // Sent by the renderer process to check whether access to DOM Storage is
485 // granted by content settings.
486 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowDOMStorage,
487                             int /* render_frame_id */,
488                             GURL /* origin_url */,
489                             GURL /* top origin url */,
490                             bool /* if true local storage, otherwise session */,
491                             bool /* allowed */)
492
493 // Sent by the renderer process to check whether access to FileSystem is
494 // granted by content settings.
495 IPC_SYNC_MESSAGE_CONTROL3_1(ChromeViewHostMsg_AllowFileSystem,
496                             int /* render_frame_id */,
497                             GURL /* origin_url */,
498                             GURL /* top origin url */,
499                             bool /* allowed */)
500
501 // Sent by the renderer process to check whether access to Indexed DBis
502 // granted by content settings.
503 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowIndexedDB,
504                             int /* render_frame_id */,
505                             GURL /* origin_url */,
506                             GURL /* top origin url */,
507                             base::string16 /* database name */,
508                             bool /* allowed */)
509
510 // Return information about a plugin for the given URL and MIME type.
511 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows
512 // about specific reasons why a plug-in can't be used, for example because it's
513 // disabled.
514 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_GetPluginInfo,
515                             int /* render_frame_id */,
516                             GURL /* url */,
517                             GURL /* top origin url */,
518                             std::string /* mime_type */,
519                             ChromeViewHostMsg_GetPluginInfo_Output /* output */)
520
521 // Returns whether any internal plugin supporting |mime_type| is registered
522 // Does not determine whether the plugin can actually be instantiated
523 // (e.g. whether it is allowed or has all its dependencies).
524 // When the returned *|is_registered| is true, |additional_param_names| and
525 // |additional_param_values| contain the name-value pairs, if any, specified
526 // for the *first* plugin found that is registered for |mime_type|.
527 IPC_SYNC_MESSAGE_CONTROL1_3(
528     ChromeViewHostMsg_IsInternalPluginRegisteredForMimeType,
529     std::string /* mime_type */,
530     bool /* registered */,
531     std::vector<base::string16> /* additional_param_names */,
532     std::vector<base::string16> /* additional_param_values */)
533
534 #if defined(ENABLE_PLUGIN_INSTALLATION)
535 // Tells the browser to search for a plug-in that can handle the given MIME
536 // type. The result will be sent asynchronously to the routing ID
537 // |placeholder_id|.
538 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_FindMissingPlugin,
539                     int /* placeholder_id */,
540                     std::string /* mime_type */)
541
542 // Notifies the browser that a missing plug-in placeholder has been removed, so
543 // the corresponding PluginPlaceholderHost can be deleted.
544 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_RemovePluginPlaceholderHost,
545                     int /* placeholder_id */)
546
547 // Notifies a missing plug-in placeholder that a plug-in with name |plugin_name|
548 // has been found.
549 IPC_MESSAGE_ROUTED1(ChromeViewMsg_FoundMissingPlugin,
550                     base::string16 /* plugin_name */)
551
552 // Notifies a missing plug-in placeholder that no plug-in has been found.
553 IPC_MESSAGE_ROUTED0(ChromeViewMsg_DidNotFindMissingPlugin)
554
555 // Notifies a missing plug-in placeholder that we have started downloading
556 // the plug-in.
557 IPC_MESSAGE_ROUTED0(ChromeViewMsg_StartedDownloadingPlugin)
558
559 // Notifies a missing plug-in placeholder that we have finished downloading
560 // the plug-in.
561 IPC_MESSAGE_ROUTED0(ChromeViewMsg_FinishedDownloadingPlugin)
562
563 // Notifies a missing plug-in placeholder that there was an error downloading
564 // the plug-in.
565 IPC_MESSAGE_ROUTED1(ChromeViewMsg_ErrorDownloadingPlugin,
566                     std::string /* message */)
567 #endif  // defined(ENABLE_PLUGIN_INSTALLATION)
568
569 // Notifies a missing plug-in placeholder that the user cancelled downloading
570 // the plug-in.
571 IPC_MESSAGE_ROUTED0(ChromeViewMsg_CancelledDownloadingPlugin)
572
573 // Tells the browser to open chrome://plugins in a new tab. We use a separate
574 // message because renderer processes aren't allowed to directly navigate to
575 // chrome:// URLs.
576 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_OpenAboutPlugins)
577
578 // Tells the browser that there was an error loading a plug-in.
579 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_CouldNotLoadPlugin,
580                     base::FilePath /* plugin_path */)
581
582 // Tells the browser that we blocked a plug-in because NPAPI is not supported.
583 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_NPAPINotSupported,
584                     std::string /* identifer */)
585
586 // Tells the renderer that the NPAPI cannot be used. For example Ash on windows.
587 IPC_MESSAGE_ROUTED0(ChromeViewMsg_NPAPINotSupported)
588
589 // Notification that the page has an OpenSearch description document
590 // associated with it.
591 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD,
592                     int32 /* page_id */,
593                     GURL /* url of OS description document */,
594                     search_provider::OSDDType)
595
596 // Find out if the given url's security origin is installed as a search
597 // provider.
598 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetSearchProviderInstallState,
599                            GURL /* page url */,
600                            GURL /* inquiry url */,
601                            search_provider::InstallState /* install */)
602
603 // Sends back stats about the V8 heap.
604 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_V8HeapStats,
605                      int /* size of heap (allocated from the OS) */,
606                      int /* bytes in use */)
607
608 // Request for a DNS prefetch of the names in the array.
609 // NameList is typedef'ed std::vector<std::string>
610 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_DnsPrefetch,
611                      std::vector<std::string> /* hostnames */)
612
613 // Request for preconnect to host providing resource specified by URL
614 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_Preconnect,
615                      GURL /* preconnect target url */)
616
617 // Notifies when a plugin couldn't be loaded because it's outdated.
618 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedOutdatedPlugin,
619                     int /* placeholder ID */,
620                     std::string /* plug-in group identifier */)
621
622 // Notifies when a plugin couldn't be loaded because it requires
623 // user authorization.
624 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedUnauthorizedPlugin,
625                     base::string16 /* name */,
626                     std::string /* plug-in group identifier */)
627
628 // Provide the browser process with information about the WebCore resource
629 // cache and current renderer framerate.
630 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats,
631                      blink::WebCache::ResourceTypeStats)
632
633 // Notifies the browser that a page has been translated.
634 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_PageTranslated,
635                     int,                  /* page id */
636                     std::string           /* the original language */,
637                     std::string           /* the translated language */,
638                     TranslateErrors::Type /* the error type if available */)
639
640 // Message sent from the renderer to the browser to notify it of a
641 // window.print() call which should cancel the prerender. The message is sent
642 // only when the renderer is prerendering.
643 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting)
644
645 // Sent by the renderer to check if a URL has permission to trigger a clipboard
646 // read/write operation from the DOM.
647 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardRead,
648                             GURL /* origin */,
649                             bool /* allowed */)
650 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardWrite,
651                             GURL /* origin */,
652                             bool /* allowed */)
653
654 // Sent when the renderer was prevented from displaying insecure content in
655 // a secure page by a security policy.  The page may appear incomplete.
656 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockDisplayingInsecureContent)
657
658 // Sent when the renderer was prevented from running insecure content in
659 // a secure origin by a security policy.  The page may appear incomplete.
660 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockRunningInsecureContent)
661
662 #if defined(OS_ANDROID)
663 // Contains info about whether the current page can be treated as a webapp.
664 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveWebappInformation,
665                     bool /* success */,
666                     bool /* is_mobile_webapp_capable */,
667                     bool /* is_apple_mobile_webapp_capable */,
668                     GURL /* expected_url */)
669
670 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveMetaTagContent,
671                     bool /* success */,
672                     std::string /* tag_name */,
673                     std::string /* tag_content */,
674                     GURL /* expected_url */)
675 #endif  // defined(OS_ANDROID)
676
677 // The currently displayed PDF has an unsupported feature.
678 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_PDFHasUnsupportedFeature)
679
680 // Brings up SaveAs... dialog to save specified URL.
681 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_PDFSaveURLAs,
682                     GURL /* url */,
683                     content::Referrer /* referrer */)
684
685 // Updates the content restrictions, i.e. to disable print/copy.
686 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_PDFUpdateContentRestrictions,
687                     int /* restrictions */)
688
689 // Brings up a Password... dialog for protected documents.
690 IPC_SYNC_MESSAGE_ROUTED1_1(ChromeViewHostMsg_PDFModalPromptForPassword,
691                            std::string /* prompt */,
692                            std::string /* actual_value */)
693
694 // This message indicates the error appeared in the frame.
695 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_FrameLoadingError,
696                     int /* error */)
697
698 // This message indicates the monitored frame loading had completed.
699 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_FrameLoadingCompleted)
700
701 // Provide the browser process with current renderer framerate.
702 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_FPS,
703                      int /* routing id */,
704                      float /* frames per second */)
705
706 // Logs events from InstantExtended New Tab Pages.
707 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_LogEvent,
708                     int /* page_id */,
709                     NTPLoggingEventType /* event */)
710
711 // Logs an impression on one of the Most Visited tile on the InstantExtended
712 // New Tab Page.
713 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_LogMostVisitedImpression,
714                     int /* page_id */,
715                     int /* position */,
716                     base::string16 /* provider */)
717
718 // Logs a navigation on one of the Most Visited tile on the InstantExtended
719 // New Tab Page.
720 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_LogMostVisitedNavigation,
721                     int /* page_id */,
722                     int /* position */,
723                     base::string16 /* provider */)
724
725 // The Instant page asks for Chrome identity check against |identity|.
726 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_ChromeIdentityCheck,
727                     int /* page_id */,
728                     base::string16 /* identity */)
729
730 // Tells InstantExtended to set the omnibox focus state.
731 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_FocusOmnibox,
732                     int /* page_id */,
733                     OmniboxFocusState /* state */)
734
735 // Tells InstantExtended to paste text into the omnibox.  If text is empty,
736 // the clipboard contents will be pasted. This causes the omnibox dropdown to
737 // open.
738 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_PasteAndOpenDropdown,
739                     int /* page_id */,
740                     base::string16 /* text to be pasted */)
741
742 // Tells InstantExtended whether the embedded search API is supported.
743 // See http://dev.chromium.org/embeddedsearch
744 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_InstantSupportDetermined,
745                     int /* page_id */,
746                     bool /* result */)
747
748 // Tells InstantExtended to delete a most visited item.
749 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem,
750                     int /* page_id */,
751                     GURL /* url */)
752
753 // Tells InstantExtended to navigate the active tab to a possibly privileged
754 // URL.
755 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_SearchBoxNavigate,
756                     int /* page_id */,
757                     GURL /* destination */,
758                     WindowOpenDisposition /* disposition */,
759                     bool /*is_most_visited_item_url*/)
760
761 // Tells InstantExtended to undo all most visited item deletions.
762 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions,
763                     int /* page_id */)
764
765 // Tells InstantExtended to undo one most visited item deletion.
766 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion,
767                     int /* page_id */,
768                     GURL /* url */)
769
770 // Tells InstantExtended whether the page supports voice search.
771 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SetVoiceSearchSupported,
772                     int /* page_id */,
773                     bool /* supported */)
774
775 // Tells the renderer a list of URLs which should be bounced back to the browser
776 // process so that they can be assigned to an Instant renderer.
777 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetSearchURLs,
778                      std::vector<GURL> /* search_urls */,
779                      GURL /* new_tab_page_url */)
780
781 // Tells listeners that a detailed message was reported to the console by
782 // WebKit.
783 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DetailedConsoleMessageAdded,
784                     base::string16 /* message */,
785                     base::string16 /* source */,
786                     extensions::StackTrace /* stack trace */,
787                     int32 /* severity level */)
788
789 // Sent by the renderer to check if crash reporting is enabled.
790 IPC_SYNC_MESSAGE_CONTROL0_1(ChromeViewHostMsg_IsCrashReportingEnabled,
791                             bool /* enabled */)
792
793 #if defined(CLD2_DYNAMIC_MODE)
794 // Informs the browser process that Compact Language Detector (CLD) data is
795 // required by the originating renderer. The browser process should respond
796 // with a ChromeViewMsg_CLDDataAvailable if the data is available, else it
797 // should go unanswered (the renderer will ask again later).
798 // See also: ChromeViewMsg_CLDDataAvailable
799 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_NeedCLDData)
800 #endif