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