Upstream version 5.34.104.0
[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 <map>
7 #include <set>
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
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 // Tells the renderer to dump as much memory as it can, perhaps because we
266 // have memory pressure or the renderer is (or will be) paged out.  This
267 // should only result in purging objects we can recalculate, e.g. caches or
268 // JS garbage, not in purging irreplaceable objects.
269 IPC_MESSAGE_CONTROL0(ChromeViewMsg_PurgeMemory)
270
271 // For WebUI testing, this message stores parameters to do ScriptEvalRequest at
272 // a time which is late enough to not be thrown out, and early enough to be
273 // before onload events are fired.
274 IPC_MESSAGE_ROUTED4(ChromeViewMsg_WebUIJavaScript,
275                     base::string16,  /* frame_xpath */
276                     base::string16,  /* jscript_url */
277                     int,  /* ID */
278                     bool  /* If true, result is sent back. */)
279
280 // Set the content setting rules stored by the renderer.
281 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetContentSettingRules,
282                      RendererContentSettingRules /* rules */)
283
284 // Tells the render frame to load all blocked plugins with the given identifier.
285 IPC_MESSAGE_ROUTED1(ChromeViewMsg_LoadBlockedPlugins,
286                     std::string /* identifier */)
287
288 // Asks the renderer to send back stats on the WebCore cache broken down by
289 // resource types.
290 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetCacheResourceStats)
291
292 // Tells the renderer to create a FieldTrial, and by using a 100% probability
293 // for the FieldTrial, forces the FieldTrial to have assigned group name.
294 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetFieldTrialGroup,
295                      std::string /* field trial name */,
296                      std::string /* group name that was assigned. */)
297
298 // Asks the renderer to send back V8 heap stats.
299 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetV8HeapStats)
300
301 IPC_MESSAGE_ROUTED0(ChromeViewMsg_DetermineIfPageSupportsInstant)
302
303 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetDisplayInstantResults,
304                     bool /* display_instant_results */)
305
306 IPC_MESSAGE_ROUTED2(ChromeViewMsg_SearchBoxFocusChanged,
307                     OmniboxFocusState /* new_focus_state */,
308                     OmniboxFocusChangeReason /* reason */)
309
310 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMarginChange, int /* start */)
311
312 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMostVisitedItemsChanged,
313                     std::vector<InstantMostVisitedItem> /* items */)
314
315 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxPromoInformation,
316                     bool /* is_app_launcher_enabled */)
317
318 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetInputInProgress,
319                     bool /* input_in_progress */)
320
321 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSetSuggestionToPrefetch,
322                     InstantSuggestion /* suggestion */)
323
324 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSubmit,
325                     base::string16 /* value */)
326
327 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxThemeChanged,
328                     ThemeBackgroundInfo /* value */)
329
330 IPC_MESSAGE_ROUTED2(ChromeViewMsg_ChromeIdentityCheckResult,
331                     base::string16 /* identity */,
332                     bool /* identity_match */)
333
334 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch)
335
336 // Toggles visual muting of the render view area. This is on when a constrained
337 // window is showing.
338 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized,
339                     bool /* deemphazied */)
340
341 // Tells the renderer to translate the page contents from one language to
342 // another.
343 IPC_MESSAGE_ROUTED4(ChromeViewMsg_TranslatePage,
344                     int /* page id */,
345                     std::string, /* the script injected in the page */
346                     std::string, /* BCP 47/RFC 5646 language code the page
347                                     is in */
348                     std::string /* BCP 47/RFC 5646 language code to translate
349                                    to */)
350
351 // Tells the renderer to revert the text of translated page to its original
352 // contents.
353 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RevertTranslation,
354                     int /* page id */)
355
356 // Sent on process startup to indicate whether this process is running in
357 // incognito mode.
358 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess,
359                      bool /* is_incognito_processs */)
360
361 // Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent.
362 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent,
363                     bool /* allowed */)
364
365 // Sent in response to ViewHostMsg_DidBlockRunningInsecureContent.
366 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowRunningInsecureContent,
367                     bool /* allowed */)
368
369 IPC_MESSAGE_ROUTED0(ChromeViewMsg_ReloadFrame)
370
371 // Sent when the profile changes the kSafeBrowsingEnabled preference.
372 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetClientSidePhishingDetection,
373                     bool /* enable_phishing_detection */)
374
375 // Asks the renderer for a thumbnail of the image selected by the most
376 // recently opened context menu, if there is one. If the image's area
377 // is greater than thumbnail_min_area it will be downscaled to
378 // be within thumbnail_max_size. The possibly downsampled image will be
379 // returned in a ChromeViewHostMsg_RequestThumbnailForContextNode_ACK message.
380 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestThumbnailForContextNode,
381                     int /* thumbnail_min_area_pixels */,
382                     gfx::Size /* thumbnail_max_size_pixels */)
383
384 // Notifies the renderer whether hiding/showing the top controls is enabled,
385 // what the current state should be, and whether or not to animate to the
386 // proper state.
387 IPC_MESSAGE_ROUTED3(ChromeViewMsg_UpdateTopControlsState,
388                     content::TopControlsState /* constraints */,
389                     content::TopControlsState /* current */,
390                     bool /* animate */)
391
392
393 // Updates the window features of the render view.
394 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetWindowFeatures,
395                     blink::WebWindowFeatures /* window_features */)
396
397 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_RequestThumbnailForContextNode_ACK,
398                     SkBitmap /* thumbnail */,
399                     gfx::Size /* original size of the image */)
400
401 #if defined(OS_ANDROID)
402 // Asks the renderer to return information about whether the current page can
403 // be treated as a webapp.
404 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RetrieveWebappInformation,
405                     GURL /* expected_url */)
406
407 // Asks the renderer to return information about the given meta tag.
408 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RetrieveMetaTagContent,
409                     GURL /* expected_url */,
410                     std::string /* tag_name */ )
411 #endif  // defined(OS_ANDROID)
412
413 // chrome.principals messages ------------------------------------------------
414
415 // Message sent from the renderer to the browser to get the list of browser
416 // managed accounts for the given origin.
417 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts,
418                             GURL /* current URL */,
419                             std::vector<std::string> /* managed accounts */)
420
421 // Message sent from the renderer to the browser to show the browser account
422 // management UI.
423 IPC_MESSAGE_CONTROL0(ChromeViewHostMsg_ShowBrowserAccountManagementUI)
424
425 // JavaScript related messages -----------------------------------------------
426
427 // Notify the JavaScript engine in the render to change its parameters
428 // while performing stress testing.
429 IPC_MESSAGE_ROUTED2(ChromeViewMsg_JavaScriptStressTestControl,
430                     int /* cmd */,
431                     int /* param */)
432
433 // Asks the renderer to send back FPS.
434 IPC_MESSAGE_ROUTED0(ChromeViewMsg_GetFPS)
435
436 // Tells the frame it is displaying an interstitial page.
437 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SetAsInterstitial)
438
439 // Provides the renderer with the results of the browser's investigation into
440 // why a recent main frame load failed (currently, just DNS probe result).
441 // NetErrorHelper will receive this mesage and replace or update the error
442 // page with more specific troubleshooting suggestions.
443 IPC_MESSAGE_ROUTED1(ChromeViewMsg_NetErrorInfo,
444                     int /* DNS probe status */)
445
446 // Sets the alternate error page URL (Link Doctor) for the renderer process.
447 // Handled by the NetErrorHelper.
448 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAltErrorPageURL, GURL)
449
450 //-----------------------------------------------------------------------------
451 // Misc messages
452 // These are messages sent from the renderer to the browser process.
453
454 // Notification that the language for the tab has been determined.
455 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_TranslateLanguageDetermined,
456                     LanguageDetectionDetails /* details about lang detection */,
457                     bool /* whether the page needs translation */)
458
459 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats,
460                      blink::WebCache::UsageStats /* stats */)
461
462 // Tells the browser that content in the current page was blocked due to the
463 // user's content settings.
464 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_ContentBlocked,
465                     ContentSettingsType /* type of blocked content */)
466
467 // Sent by the renderer process to check whether access to web databases is
468 // granted by content settings.
469 IPC_SYNC_MESSAGE_CONTROL5_1(ChromeViewHostMsg_AllowDatabase,
470                             int /* render_frame_id */,
471                             GURL /* origin_url */,
472                             GURL /* top origin url */,
473                             base::string16 /* database name */,
474                             base::string16 /* database display name */,
475                             bool /* allowed */)
476
477 // Sent by the renderer process to check whether access to DOM Storage is
478 // granted by content settings.
479 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowDOMStorage,
480                             int /* render_frame_id */,
481                             GURL /* origin_url */,
482                             GURL /* top origin url */,
483                             bool /* if true local storage, otherwise session */,
484                             bool /* allowed */)
485
486 // Sent by the renderer process to check whether access to FileSystem is
487 // granted by content settings.
488 IPC_SYNC_MESSAGE_CONTROL3_1(ChromeViewHostMsg_AllowFileSystem,
489                             int /* render_frame_id */,
490                             GURL /* origin_url */,
491                             GURL /* top origin url */,
492                             bool /* allowed */)
493
494 // Sent by the renderer process to check whether access to Indexed DBis
495 // granted by content settings.
496 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowIndexedDB,
497                             int /* render_frame_id */,
498                             GURL /* origin_url */,
499                             GURL /* top origin url */,
500                             base::string16 /* database name */,
501                             bool /* allowed */)
502
503 // Return information about a plugin for the given URL and MIME type.
504 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows
505 // about specific reasons why a plug-in can't be used, for example because it's
506 // disabled.
507 IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_GetPluginInfo,
508                             int /* render_frame_id */,
509                             GURL /* url */,
510                             GURL /* top origin url */,
511                             std::string /* mime_type */,
512                             ChromeViewHostMsg_GetPluginInfo_Output /* output */)
513
514 // Returns whether any internal plugin supporting |mime_type| is registered
515 // Does not determine whether the plugin can actually be instantiated
516 // (e.g. whether it is allowed or has all its dependencies).
517 // When the returned *|is_registered| is true, |additional_param_names| and
518 // |additional_param_values| contain the name-value pairs, if any, specified
519 // for the *first* plugin found that is registered for |mime_type|.
520 IPC_SYNC_MESSAGE_CONTROL1_3(
521     ChromeViewHostMsg_IsInternalPluginRegisteredForMimeType,
522     std::string /* mime_type */,
523     bool /* registered */,
524     std::vector<base::string16> /* additional_param_names */,
525     std::vector<base::string16> /* additional_param_values */)
526
527 #if defined(ENABLE_PLUGIN_INSTALLATION)
528 // Tells the browser to search for a plug-in that can handle the given MIME
529 // type. The result will be sent asynchronously to the routing ID
530 // |placeholder_id|.
531 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_FindMissingPlugin,
532                     int /* placeholder_id */,
533                     std::string /* mime_type */)
534
535 // Notifies the browser that a missing plug-in placeholder has been removed, so
536 // the corresponding PluginPlaceholderHost can be deleted.
537 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_RemovePluginPlaceholderHost,
538                     int /* placeholder_id */)
539
540 // Notifies a missing plug-in placeholder that a plug-in with name |plugin_name|
541 // has been found.
542 IPC_MESSAGE_ROUTED1(ChromeViewMsg_FoundMissingPlugin,
543                     base::string16 /* plugin_name */)
544
545 // Notifies a missing plug-in placeholder that no plug-in has been found.
546 IPC_MESSAGE_ROUTED0(ChromeViewMsg_DidNotFindMissingPlugin)
547
548 // Notifies a missing plug-in placeholder that we have started downloading
549 // the plug-in.
550 IPC_MESSAGE_ROUTED0(ChromeViewMsg_StartedDownloadingPlugin)
551
552 // Notifies a missing plug-in placeholder that we have finished downloading
553 // the plug-in.
554 IPC_MESSAGE_ROUTED0(ChromeViewMsg_FinishedDownloadingPlugin)
555
556 // Notifies a missing plug-in placeholder that there was an error downloading
557 // the plug-in.
558 IPC_MESSAGE_ROUTED1(ChromeViewMsg_ErrorDownloadingPlugin,
559                     std::string /* message */)
560 #endif  // defined(ENABLE_PLUGIN_INSTALLATION)
561
562 // Notifies a missing plug-in placeholder that the user cancelled downloading
563 // the plug-in.
564 IPC_MESSAGE_ROUTED0(ChromeViewMsg_CancelledDownloadingPlugin)
565
566 // Tells the browser to open chrome://plugins in a new tab. We use a separate
567 // message because renderer processes aren't allowed to directly navigate to
568 // chrome:// URLs.
569 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_OpenAboutPlugins)
570
571 // Tells the browser that there was an error loading a plug-in.
572 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_CouldNotLoadPlugin,
573                     base::FilePath /* plugin_path */)
574
575 // Tells the browser that we blocked a plug-in because NPAPI is not supported.
576 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_NPAPINotSupported,
577                     std::string /* identifer */)
578
579 // Tells the renderer that the NPAPI cannot be used. For example Ash on windows.
580 IPC_MESSAGE_ROUTED0(ChromeViewMsg_NPAPINotSupported)
581
582 // Notification that the page has an OpenSearch description document
583 // associated with it.
584 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD,
585                     int32 /* page_id */,
586                     GURL /* url of OS description document */,
587                     search_provider::OSDDType)
588
589 // Find out if the given url's security origin is installed as a search
590 // provider.
591 IPC_SYNC_MESSAGE_ROUTED2_1(ChromeViewHostMsg_GetSearchProviderInstallState,
592                            GURL /* page url */,
593                            GURL /* inquiry url */,
594                            search_provider::InstallState /* install */)
595
596 // Sends back stats about the V8 heap.
597 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_V8HeapStats,
598                      int /* size of heap (allocated from the OS) */,
599                      int /* bytes in use */)
600
601 // Request for a DNS prefetch of the names in the array.
602 // NameList is typedef'ed std::vector<std::string>
603 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_DnsPrefetch,
604                      std::vector<std::string> /* hostnames */)
605
606 // Request for preconnect to host providing resource specified by URL
607 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_Preconnect,
608                      GURL /* preconnect target url */)
609
610 // Notifies when a plugin couldn't be loaded because it's outdated.
611 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedOutdatedPlugin,
612                     int /* placeholder ID */,
613                     std::string /* plug-in group identifier */)
614
615 // Notifies when a plugin couldn't be loaded because it requires
616 // user authorization.
617 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedUnauthorizedPlugin,
618                     base::string16 /* name */,
619                     std::string /* plug-in group identifier */)
620
621 // Provide the browser process with information about the WebCore resource
622 // cache and current renderer framerate.
623 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats,
624                      blink::WebCache::ResourceTypeStats)
625
626 // Notifies the browser that a page has been translated.
627 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_PageTranslated,
628                     int,                  /* page id */
629                     std::string           /* the original language */,
630                     std::string           /* the translated language */,
631                     TranslateErrors::Type /* the error type if available */)
632
633 // Message sent from the renderer to the browser to notify it of a
634 // window.print() call which should cancel the prerender. The message is sent
635 // only when the renderer is prerendering.
636 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting)
637
638 // Sent by the renderer to check if a URL has permission to trigger a clipboard
639 // read/write operation from the DOM.
640 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardRead,
641                             GURL /* origin */,
642                             bool /* allowed */)
643 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardWrite,
644                             GURL /* origin */,
645                             bool /* allowed */)
646
647 // Sent when the renderer was prevented from displaying insecure content in
648 // a secure page by a security policy.  The page may appear incomplete.
649 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockDisplayingInsecureContent)
650
651 // Sent when the renderer was prevented from running insecure content in
652 // a secure origin by a security policy.  The page may appear incomplete.
653 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockRunningInsecureContent)
654
655 #if defined(OS_ANDROID)
656 // Contains info about whether the current page can be treated as a webapp.
657 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveWebappInformation,
658                     bool /* success */,
659                     bool /* is_mobile_webapp_capable */,
660                     bool /* is_apple_mobile_webapp_capable */,
661                     GURL /* expected_url */)
662
663 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveMetaTagContent,
664                     bool /* success */,
665                     std::string /* tag_name */,
666                     std::string /* tag_content */,
667                     GURL /* expected_url */)
668 #endif  // defined(OS_ANDROID)
669
670 // The currently displayed PDF has an unsupported feature.
671 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_PDFHasUnsupportedFeature)
672
673 // Brings up SaveAs... dialog to save specified URL.
674 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_PDFSaveURLAs,
675                     GURL /* url */,
676                     content::Referrer /* referrer */)
677
678 // Updates the content restrictions, i.e. to disable print/copy.
679 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_PDFUpdateContentRestrictions,
680                     int /* restrictions */)
681
682 // Brings up a Password... dialog for protected documents.
683 IPC_SYNC_MESSAGE_ROUTED1_1(ChromeViewHostMsg_PDFModalPromptForPassword,
684                            std::string /* prompt */,
685                            std::string /* actual_value */)
686
687 // This message indicates the error appeared in the frame.
688 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_FrameLoadingError,
689                     int /* error */)
690
691 // This message indicates the monitored frame loading had completed.
692 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_FrameLoadingCompleted)
693
694 // Provide the browser process with current renderer framerate.
695 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_FPS,
696                      int /* routing id */,
697                      float /* frames per second */)
698
699 // Logs events from InstantExtended New Tab Pages.
700 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_LogEvent,
701                     int /* page_id */,
702                     NTPLoggingEventType /* event */)
703
704 // Logs an impression on one of the Most Visited tile on the InstantExtended
705 // New Tab Page.
706 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_LogImpression,
707                     int /* page_id */,
708                     int /* position */,
709                     base::string16 /* provider */)
710
711 // The Instant page asks for Chrome identity check against |identity|.
712 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_ChromeIdentityCheck,
713                     int /* page_id */,
714                     base::string16 /* identity */)
715
716 // Tells InstantExtended to set the omnibox focus state.
717 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_FocusOmnibox,
718                     int /* page_id */,
719                     OmniboxFocusState /* state */)
720
721 // Tells InstantExtended to paste text into the omnibox.  If text is empty,
722 // the clipboard contents will be pasted. This causes the omnibox dropdown to
723 // open.
724 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_PasteAndOpenDropdown,
725                     int /* page_id */,
726                     base::string16 /* text to be pasted */)
727
728 // Tells InstantExtended whether the embedded search API is supported.
729 // See http://dev.chromium.org/embeddedsearch
730 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_InstantSupportDetermined,
731                     int /* page_id */,
732                     bool /* result */)
733
734 // Tells InstantExtended to delete a most visited item.
735 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem,
736                     int /* page_id */,
737                     GURL /* url */)
738
739 // Tells InstantExtended to navigate the active tab to a possibly privileged
740 // URL.
741 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_SearchBoxNavigate,
742                     int /* page_id */,
743                     GURL /* destination */,
744                     WindowOpenDisposition /* disposition */,
745                     bool /*is_most_visited_item_url*/)
746
747 // Tells InstantExtended to undo all most visited item deletions.
748 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions,
749                     int /* page_id */)
750
751 // Tells InstantExtended to undo one most visited item deletion.
752 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion,
753                     int /* page_id */,
754                     GURL /* url */)
755
756 // Tells InstantExtended whether the page supports voice search.
757 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SetVoiceSearchSupported,
758                     int /* page_id */,
759                     bool /* supported */)
760
761 // Tells the renderer a list of URLs which should be bounced back to the browser
762 // process so that they can be assigned to an Instant renderer.
763 IPC_MESSAGE_CONTROL2(ChromeViewMsg_SetSearchURLs,
764                      std::vector<GURL> /* search_urls */,
765                      GURL /* new_tab_page_url */)
766
767 // Tells listeners that a detailed message was reported to the console by
768 // WebKit.
769 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DetailedConsoleMessageAdded,
770                     base::string16 /* message */,
771                     base::string16 /* source */,
772                     extensions::StackTrace /* stack trace */,
773                     int32 /* severity level */)