Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/common/render_messages_params.h

Issue 3119035: FBTF: Move individual XXXMsg_Params structs to a new file. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix comment Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/render_messages.cc ('k') | chrome/common/render_messages_params.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
6 #define CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
7 #pragma once
8
9 #include <string>
10 #include <vector>
11
12 #include "app/surface/transport_dib.h"
13 #include "base/file_path.h"
14 #include "base/ref_counted.h"
15 #include "base/shared_memory.h"
16 #include "base/time.h"
17 #include "base/values.h"
18 #include "chrome/common/dom_storage_common.h"
19 #include "chrome/common/extensions/extension_extent.h"
20 #include "chrome/common/extensions/url_pattern.h"
21 #include "chrome/common/indexed_db_key.h"
22 #include "chrome/common/navigation_gesture.h"
23 #include "chrome/common/navigation_types.h"
24 #include "chrome/common/page_transition_types.h"
25 #include "chrome/common/renderer_preferences.h"
26 #include "chrome/common/window_container_type.h"
27 #include "googleurl/src/gurl.h"
28 #include "ipc/ipc_param_traits.h"
29 #include "media/audio/audio_io.h"
30 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h"
31 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
32 #include "webkit/glue/password_form.h"
33 #include "webkit/glue/plugins/webplugin.h"
34 #include "webkit/glue/resource_type.h"
35 #include "webkit/glue/webmenuitem.h"
36 #include "webkit/glue/webpreferences.h"
37
38 // TODO(erg): Split this file into $1_db_params.h, $1_audio_params.h,
39 // $1_print_params.h and $1_render_params.h.
40
41 namespace net {
42 class UploadData;
43 }
44
45 // Parameters structure for ViewMsg_Navigate, which has too many data
46 // parameters to be reasonably put in a predefined IPC message.
47 struct ViewMsg_Navigate_Params {
48 enum NavigationType {
49 // Reload the page.
50 RELOAD,
51
52 // Reload the page, ignoring any cache entries.
53 RELOAD_IGNORING_CACHE,
54
55 // The navigation is the result of session restore and should honor the
56 // page's cache policy while restoring form state. This is set to true if
57 // restoring a tab/session from the previous session and the previous
58 // session did not crash. If this is not set and the page was restored then
59 // the page's cache policy is ignored and we load from the cache.
60 RESTORE,
61
62 // Navigation type not categorized by the other types.
63 NORMAL
64 };
65
66 // The page_id for this navigation, or -1 if it is a new navigation. Back,
67 // Forward, and Reload navigations should have a valid page_id. If the load
68 // succeeds, then this page_id will be reflected in the resultant
69 // ViewHostMsg_FrameNavigate message.
70 int32 page_id;
71
72 // If page_id is -1, then pending_history_list_offset will also be -1.
73 // Otherwise, it contains the offset into the history list corresponding to
74 // the current navigation.
75 int pending_history_list_offset;
76
77 // Informs the RenderView of where its current page contents reside in
78 // session history and the total size of the session history list.
79 int current_history_list_offset;
80 int current_history_list_length;
81
82 // The URL to load.
83 GURL url;
84
85 // The URL to send in the "Referer" header field. Can be empty if there is
86 // no referrer.
87 GURL referrer;
88
89 // The type of transition.
90 PageTransition::Type transition;
91
92 // Opaque history state (received by ViewHostMsg_UpdateState).
93 std::string state;
94
95 // Type of navigation.
96 NavigationType navigation_type;
97
98 // The time the request was created
99 base::Time request_time;
100 };
101
102 // Current status of the audio output stream in the browser process. Browser
103 // sends information about the current playback state and error to the
104 // renderer process using this type.
105 struct ViewMsg_AudioStreamState_Params {
106 enum State {
107 kPlaying,
108 kPaused,
109 kError
110 };
111
112 // Carries the current playback state.
113 State state;
114 };
115
116 // The user has completed a find-in-page; this type defines what actions the
117 // renderer should take next.
118 struct ViewMsg_StopFinding_Params {
119 enum Action {
120 kClearSelection,
121 kKeepSelection,
122 kActivateSelection
123 };
124
125 // The action that should be taken when the find is completed.
126 Action action;
127 };
128
129 // The install state of the search provider (not installed, installed, default).
130 struct ViewHostMsg_GetSearchProviderInstallState_Params {
131 enum State {
132 // Equates to an access denied error.
133 DENIED = -1,
134
135 // DON'T CHANGE THE VALUES BELOW.
136 // All of the following values are manidated by the
137 // spec for window.external.IsSearchProviderInstalled.
138
139 // The search provider is not installed.
140 NOT_INSTALLED = 0,
141
142 // The search provider is in the user's set but is not
143 INSTALLED_BUT_NOT_DEFAULT = 1,
144
145 // The search provider is set as the user's default.
146 INSTALLED_AS_DEFAULT = 2
147 };
148 State state;
149
150 ViewHostMsg_GetSearchProviderInstallState_Params()
151 : state(DENIED) {
152 }
153
154 explicit ViewHostMsg_GetSearchProviderInstallState_Params(State s)
155 : state(s) {
156 }
157
158 static ViewHostMsg_GetSearchProviderInstallState_Params Denied() {
159 return ViewHostMsg_GetSearchProviderInstallState_Params(DENIED);
160 }
161
162 static ViewHostMsg_GetSearchProviderInstallState_Params NotInstalled() {
163 return ViewHostMsg_GetSearchProviderInstallState_Params(NOT_INSTALLED);
164 }
165
166 static ViewHostMsg_GetSearchProviderInstallState_Params
167 InstallButNotDefault() {
168 return ViewHostMsg_GetSearchProviderInstallState_Params(
169 INSTALLED_BUT_NOT_DEFAULT);
170 }
171
172 static ViewHostMsg_GetSearchProviderInstallState_Params InstalledAsDefault() {
173 return ViewHostMsg_GetSearchProviderInstallState_Params(
174 INSTALLED_AS_DEFAULT);
175 }
176 };
177
178 // Parameters structure for ViewHostMsg_FrameNavigate, which has too many data
179 // parameters to be reasonably put in a predefined IPC message.
180 struct ViewHostMsg_FrameNavigate_Params {
181 // Page ID of this navigation. The renderer creates a new unique page ID
182 // anytime a new session history entry is created. This means you'll get new
183 // page IDs for user actions, and the old page IDs will be reloaded when
184 // iframes are loaded automatically.
185 int32 page_id;
186
187 // URL of the page being loaded.
188 GURL url;
189
190 // URL of the referrer of this load. WebKit generates this based on the
191 // source of the event that caused the load.
192 GURL referrer;
193
194 // The type of transition.
195 PageTransition::Type transition;
196
197 // Lists the redirects that occurred on the way to the current page. This
198 // vector has the same format as reported by the WebDataSource in the glue,
199 // with the current page being the last one in the list (so even when
200 // there's no redirect, there will be one entry in the list.
201 std::vector<GURL> redirects;
202
203 // Set to false if we want to update the session history but not update
204 // the browser history. E.g., on unreachable urls.
205 bool should_update_history;
206
207 // See SearchableFormData for a description of these.
208 GURL searchable_form_url;
209 std::string searchable_form_encoding;
210
211 // See password_form.h.
212 webkit_glue::PasswordForm password_form;
213
214 // Information regarding the security of the connection (empty if the
215 // connection was not secure).
216 std::string security_info;
217
218 // The gesture that initiated this navigation.
219 NavigationGesture gesture;
220
221 // Contents MIME type of main frame.
222 std::string contents_mime_type;
223
224 // True if this was a post request.
225 bool is_post;
226
227 // Whether the content of the frame was replaced with some alternate content
228 // (this can happen if the resource was insecure).
229 bool is_content_filtered;
230
231 // The status code of the HTTP request.
232 int http_status_code;
233 };
234
235 // Values that may be OR'd together to form the 'flags' parameter of a
236 // ViewHostMsg_UpdateRect_Params structure.
237 struct ViewHostMsg_UpdateRect_Flags {
238 enum {
239 IS_RESIZE_ACK = 1 << 0,
240 IS_RESTORE_ACK = 1 << 1,
241 IS_REPAINT_ACK = 1 << 2,
242 };
243 static bool is_resize_ack(int flags) {
244 return (flags & IS_RESIZE_ACK) != 0;
245 }
246 static bool is_restore_ack(int flags) {
247 return (flags & IS_RESTORE_ACK) != 0;
248 }
249 static bool is_repaint_ack(int flags) {
250 return (flags & IS_REPAINT_ACK) != 0;
251 }
252 };
253
254 struct ViewHostMsg_UpdateRect_Params {
255 // The bitmap to be painted into the view at the locations specified by
256 // update_rects.
257 TransportDIB::Id bitmap;
258
259 // The position and size of the bitmap.
260 gfx::Rect bitmap_rect;
261
262 // The scroll offset. Only one of these can be non-zero, and if they are
263 // both zero, then it means there is no scrolling and the scroll_rect is
264 // ignored.
265 int dx;
266 int dy;
267
268 // The rectangular region to scroll.
269 gfx::Rect scroll_rect;
270
271 // The regions of the bitmap (in view coords) that contain updated pixels.
272 // In the case of scrolling, this includes the scroll damage rect.
273 std::vector<gfx::Rect> copy_rects;
274
275 // The size of the RenderView when this message was generated. This is
276 // included so the host knows how large the view is from the perspective of
277 // the renderer process. This is necessary in case a resize operation is in
278 // progress.
279 gfx::Size view_size;
280
281 // New window locations for plugin child windows.
282 std::vector<webkit_glue::WebPluginGeometry> plugin_window_moves;
283
284 // The following describes the various bits that may be set in flags:
285 //
286 // ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK
287 // Indicates that this is a response to a ViewMsg_Resize message.
288 //
289 // ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK
290 // Indicates that this is a response to a ViewMsg_WasRestored message.
291 //
292 // ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK
293 // Indicates that this is a response to a ViewMsg_Repaint message.
294 //
295 // If flags is zero, then this message corresponds to an unsoliticed paint
296 // request by the render view. Any of the above bits may be set in flags,
297 // which would indicate that this paint message is an ACK for multiple
298 // request messages.
299 int flags;
300 };
301
302 // Information on closing a tab. This is used both for ViewMsg_ClosePage, and
303 // the corresponding ViewHostMsg_ClosePage_ACK.
304 struct ViewMsg_ClosePage_Params {
305 // The identifier of the RenderProcessHost for the currently closing view.
306 //
307 // These first two parameters are technically redundant since they are
308 // needed only when processing the ACK message, and the processor
309 // theoretically knows both the process and route ID. However, this is
310 // difficult to figure out with our current implementation, so this
311 // information is duplicate here.
312 int closing_process_id;
313
314 // The route identifier for the currently closing RenderView.
315 int closing_route_id;
316
317 // True when this close is for the first (closing) tab of a cross-site
318 // transition where we switch processes. False indicates the close is for the
319 // entire tab.
320 //
321 // When true, the new_* variables below must be filled in. Otherwise they must
322 // both be -1.
323 bool for_cross_site_transition;
324
325 // The identifier of the RenderProcessHost for the new view attempting to
326 // replace the closing one above. This must be valid when
327 // for_cross_site_transition is set, and must be -1 otherwise.
328 int new_render_process_host_id;
329
330 // The identifier of the *request* the new view made that is causing the
331 // cross-site transition. This is *not* a route_id, but the request that we
332 // will resume once the ACK from the closing view has been received. This
333 // must be valid when for_cross_site_transition is set, and must be -1
334 // otherwise.
335 int new_request_id;
336 };
337
338 // Parameters for a resource request.
339 struct ViewHostMsg_Resource_Request {
340 // The request method: GET, POST, etc.
341 std::string method;
342
343 // The requested URL.
344 GURL url;
345
346 // Usually the URL of the document in the top-level window, which may be
347 // checked by the third-party cookie blocking policy. Leaving it empty may
348 // lead to undesired cookie blocking. Third-party cookie blocking can be
349 // bypassed by setting first_party_for_cookies = url, but this should ideally
350 // only be done if there really is no way to determine the correct value.
351 GURL first_party_for_cookies;
352
353 // The referrer to use (may be empty).
354 GURL referrer;
355
356 // The origin of the frame that is associated with this request. This is used
357 // to update our insecure content state.
358 std::string frame_origin;
359
360 // The origin of the main frame (top-level frame) that is associated with this
361 // request. This is used to update our insecure content state.
362 std::string main_frame_origin;
363
364 // Additional HTTP request headers.
365 std::string headers;
366
367 // URLRequest load flags (0 by default).
368 int load_flags;
369
370 // Unique ID of process that originated this request. For normal renderer
371 // requests, this will be the ID of the renderer. For plugin requests routed
372 // through the renderer, this will be the plugin's ID.
373 int origin_child_id;
374
375 // What this resource load is for (main frame, sub-frame, sub-resource,
376 // object).
377 ResourceType::Type resource_type;
378
379 // Used by plugin->browser requests to get the correct URLRequestContext.
380 uint32 request_context;
381
382 // Indicates which frame (or worker context) the request is being loaded into,
383 // or kNoHostId.
384 int appcache_host_id;
385
386 // Optional upload data (may be null).
387 scoped_refptr<net::UploadData> upload_data;
388
389 bool download_to_file;
390
391 // The following two members are specified if the request is initiated by
392 // a plugin like Gears.
393
394 // Contains the id of the host renderer.
395 int host_renderer_id;
396
397 // Contains the id of the host render view.
398 int host_render_view_id;
399 };
400
401 // Parameters for a render request.
402 struct ViewMsg_Print_Params {
403 // Physical size of the page, including non-printable margins,
404 // in pixels according to dpi.
405 gfx::Size page_size;
406
407 // In pixels according to dpi_x and dpi_y.
408 gfx::Size printable_size;
409
410 // The y-offset of the printable area, in pixels according to dpi.
411 int margin_top;
412
413 // The x-offset of the printable area, in pixels according to dpi.
414 int margin_left;
415
416 // Specifies dots per inch.
417 double dpi;
418
419 // Minimum shrink factor. See PrintSettings::min_shrink for more information.
420 double min_shrink;
421
422 // Maximum shrink factor. See PrintSettings::max_shrink for more information.
423 double max_shrink;
424
425 // Desired apparent dpi on paper.
426 int desired_dpi;
427
428 // Cookie for the document to ensure correctness.
429 int document_cookie;
430
431 // Should only print currently selected text.
432 bool selection_only;
433
434 // Warning: do not compare document_cookie.
435 bool Equals(const ViewMsg_Print_Params& rhs) const;
436
437 // Checking if the current params is empty. Just initialized after a memset.
438 bool IsEmpty() const;
439 };
440
441 struct ViewMsg_PrintPage_Params {
442 // Parameters to render the page as a printed page. It must always be the same
443 // value for all the document.
444 ViewMsg_Print_Params params;
445
446 // The page number is the indicator of the square that should be rendered
447 // according to the layout specified in ViewMsg_Print_Params.
448 int page_number;
449 };
450
451 struct ViewMsg_PrintPages_Params {
452 // Parameters to render the page as a printed page. It must always be the same
453 // value for all the document.
454 ViewMsg_Print_Params params;
455
456 // If empty, this means a request to render all the printed pages.
457 std::vector<int> pages;
458 };
459
460 // Parameters to describe a rendered page.
461 struct ViewHostMsg_DidPrintPage_Params {
462 // A shared memory handle to the EMF data. This data can be quite large so a
463 // memory map needs to be used.
464 base::SharedMemoryHandle metafile_data_handle;
465
466 // Size of the metafile data.
467 uint32 data_size;
468
469 // Cookie for the document to ensure correctness.
470 int document_cookie;
471
472 // Page number.
473 int page_number;
474
475 // Shrink factor used to render this page.
476 double actual_shrink;
477
478 // The size of the page the page author specified.
479 gfx::Size page_size;
480
481 // The printable area the page author specified.
482 gfx::Rect content_area;
483
484 // True if the page has visible overlays.
485 bool has_visible_overlays;
486 };
487
488 // Parameters for creating an audio output stream.
489 struct ViewHostMsg_Audio_CreateStream_Params {
490 // Format request for the stream.
491 AudioManager::Format format;
492
493 // Number of channels.
494 int channels;
495
496 // Sampling rate (frequency) of the output stream.
497 int sample_rate;
498
499 // Number of bits per sample;
500 int bits_per_sample;
501
502 // Number of bytes per packet. Determines the maximum number of bytes
503 // transported for each audio packet request.
504 // A value of 0 means that the audio packet size is selected automatically
505 // by the browser process.
506 uint32 packet_size;
507 };
508
509 // This message is used for supporting popup menus on Mac OS X using native
510 // Cocoa controls. The renderer sends us this message which we use to populate
511 // the popup menu.
512 struct ViewHostMsg_ShowPopup_Params {
513 // Position on the screen.
514 gfx::Rect bounds;
515
516 // The height of each item in the menu.
517 int item_height;
518
519 // The size of the font to use for those items.
520 double item_font_size;
521
522 // The currently selected (displayed) item in the menu.
523 int selected_item;
524
525 // The entire list of items in the popup menu.
526 std::vector<WebMenuItem> popup_items;
527
528 // Whether items should be right-aligned.
529 bool right_aligned;
530 };
531
532 // Parameters for the IPC message ViewHostMsg_ScriptedPrint
533 struct ViewHostMsg_ScriptedPrint_Params {
534 int routing_id;
535 gfx::NativeViewId host_window_id;
536 int cookie;
537 int expected_pages_count;
538 bool has_selection;
539 bool use_overlays;
540 };
541
542 // Signals a storage event.
543 struct ViewMsg_DOMStorageEvent_Params {
544 // The key that generated the storage event. Null if clear() was called.
545 NullableString16 key_;
546
547 // The old value of this key. Null on clear() or if it didn't have a value.
548 NullableString16 old_value_;
549
550 // The new value of this key. Null on removeItem() or clear().
551 NullableString16 new_value_;
552
553 // The origin this is associated with.
554 string16 origin_;
555
556 // The URL of the page that caused the storage event.
557 GURL url_;
558
559 // The storage type of this event.
560 DOMStorageType storage_type_;
561 };
562
563 // Used to open an indexed database.
564 struct ViewHostMsg_IDBFactoryOpen_Params {
565 // The routing ID of the view initiating the open.
566 int32 routing_id_;
567
568 // The response should have this id.
569 int32 response_id_;
570
571 // The origin doing the initiating.
572 string16 origin_;
573
574 // The name of the database.
575 string16 name_;
576
577 // The description of the database.
578 string16 description_;
579 };
580
581 // Used to create an object store.
582 struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params {
583 // The response should have this id.
584 int32 response_id_;
585
586 // The name of the object store.
587 string16 name_;
588
589 // The keyPath of the object store.
590 NullableString16 key_path_;
591
592 // Whether the object store created should have a key generator.
593 bool auto_increment_;
594
595 // The database the object store belongs to.
596 int32 idb_database_id_;
597 };
598
599 // Used to create an index.
600 struct ViewHostMsg_IDBObjectStoreCreateIndex_Params {
601 // The response should have this id.
602 int32 response_id_;
603
604 // The name of the index.
605 string16 name_;
606
607 // The keyPath of the index.
608 NullableString16 key_path_;
609
610 // Whether the index created has unique keys.
611 bool unique_;
612
613 // The object store the index belongs to.
614 int32 idb_object_store_id_;
615 };
616
617 // Used to open an IndexedDB cursor.
618 struct ViewHostMsg_IDBObjectStoreOpenCursor_Params {
619 // The response should have this id.
620 int32 response_id_;
621 // The serialized left key.
622 IndexedDBKey left_key_;
623 // The serialized right key.
624 IndexedDBKey right_key_;
625 // The key flags.
626 int32 flags_;
627 // The direction of this cursor.
628 int32 direction_;
629 // The object store the index belongs to.
630 int32 idb_object_store_id_;
631 };
632
633 // Allows an extension to execute code in a tab.
634 struct ViewMsg_ExecuteCode_Params {
635 ViewMsg_ExecuteCode_Params();
636 ViewMsg_ExecuteCode_Params(int request_id, const std::string& extension_id,
637 const std::vector<URLPattern>& host_permissions,
638 bool is_javascript, const std::string& code,
639 bool all_frames);
640
641 // The extension API request id, for responding.
642 int request_id;
643
644 // The ID of the requesting extension. To know which isolated world to
645 // execute the code inside of.
646 std::string extension_id;
647
648 // The host permissions of the requesting extension. So that we can check them
649 // right before injecting, to avoid any race conditions.
650 std::vector<URLPattern> host_permissions;
651
652 // Whether the code is JavaScript or CSS.
653 bool is_javascript;
654
655 // String of code to execute.
656 std::string code;
657
658 // Whether to inject into all frames, or only the root frame.
659 bool all_frames;
660 };
661
662 // Parameters for the message that creates a worker thread.
663 struct ViewHostMsg_CreateWorker_Params {
664 // URL for the worker script.
665 GURL url;
666
667 // True if this is a SharedWorker, false if it is a dedicated Worker.
668 bool is_shared;
669
670 // Name for a SharedWorker, otherwise empty string.
671 string16 name;
672
673 // The ID of the parent document (unique within parent renderer).
674 unsigned long long document_id;
675
676 // RenderView routing id used to send messages back to the parent.
677 int render_view_route_id;
678
679 // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed,
680 // a new unique ID is created and assigned to the worker.
681 int route_id;
682
683 // The ID of the parent's appcache host, only valid for dedicated workers.
684 int parent_appcache_host_id;
685
686 // The ID of the appcache the main shared worker script resource was loaded
687 // from, only valid for shared workers.
688 int64 script_resource_appcache_id;
689 };
690
691 // Parameters for the message that creates a desktop notification.
692 struct ViewHostMsg_ShowNotification_Params {
693 // URL which is the origin that created this notification.
694 GURL origin;
695
696 // True if this is HTML
697 bool is_html;
698
699 // URL which contains the HTML contents (if is_html is true), otherwise empty.
700 GURL contents_url;
701
702 // Contents of the notification if is_html is false.
703 GURL icon_url;
704 string16 title;
705 string16 body;
706
707 // Directionality of the notification.
708 WebKit::WebTextDirection direction;
709
710 // ReplaceID if this notification should replace an existing one; may be
711 // empty if no replacement is called for.
712 string16 replace_id;
713
714 // Notification ID for sending events back for this notification.
715 int notification_id;
716 };
717
718 // Creates a new view via a control message since the view doesn't yet exist.
719 struct ViewMsg_New_Params {
720 // The parent window's id.
721 gfx::NativeViewId parent_window;
722
723 // Renderer-wide preferences.
724 RendererPreferences renderer_preferences;
725
726 // Preferences for this view.
727 WebPreferences web_preferences;
728
729 // The ID of the view to be created.
730 int32 view_id;
731
732 // The session storage namespace ID this view should use.
733 int64 session_storage_namespace_id;
734
735 // The name of the frame associated with this view (or empty if none).
736 string16 frame_name;
737 };
738
739 struct ViewHostMsg_CreateWindow_Params {
740 // Routing ID of the view initiating the open.
741 int opener_id;
742
743 // True if this open request came in the context of a user gesture.
744 bool user_gesture;
745
746 // Type of window requested.
747 WindowContainerType window_container_type;
748
749 // The session storage namespace ID this view should use.
750 int64 session_storage_namespace_id;
751
752 // The name of the resulting frame that should be created (empty if none
753 // has been specified).
754 string16 frame_name;
755 };
756
757 struct ViewHostMsg_RunFileChooser_Params {
758 enum Mode {
759 // Requires that the file exists before allowing the user to pick it.
760 Open,
761
762 // Like Open, but allows picking multiple files to open.
763 OpenMultiple,
764
765 // Allows picking a nonexistent file, and prompts to overwrite if the file
766 // already exists.
767 Save,
768 };
769
770 Mode mode;
771
772 // Title to be used for the dialog. This may be empty for the default title,
773 // which will be either "Open" or "Save" depending on the mode.
774 string16 title;
775
776 // Default file name to select in the dialog.
777 FilePath default_file_name;
778 };
779
780 struct ViewMsg_ExtensionExtentInfo {
781 std::string extension_id;
782 ExtensionExtent web_extent;
783 ExtensionExtent browse_extent;
784 };
785
786 struct ViewMsg_ExtensionExtentsUpdated_Params {
787 // Describes the installed extension apps and the URLs they cover.
788 std::vector<ViewMsg_ExtensionExtentInfo> extension_apps;
789 };
790
791 struct ViewMsg_DeviceOrientationUpdated_Params {
792 // These fields have the same meaning as in device_orientation::Orientation.
793 bool can_provide_alpha;
794 double alpha;
795 bool can_provide_beta;
796 double beta;
797 bool can_provide_gamma;
798 double gamma;
799 };
800
801 // Parameters structure for ViewHostMsg_ExtensionRequest.
802 struct ViewHostMsg_DomMessage_Params {
803 // Message name.
804 std::string name;
805
806 // List of message arguments.
807 ListValue arguments;
808
809 // URL of the frame request was sent from.
810 GURL source_url;
811
812 // Unique request id to match requests and responses.
813 int request_id;
814
815 // True if request has a callback specified.
816 bool has_callback;
817
818 // True if request is executed in response to an explicit user gesture.
819 bool user_gesture;
820 };
821
822 struct ViewHostMsg_OpenFileSystemRequest_Params {
823 // The routing ID of the view initiating the request.
824 int routing_id;
825
826 // The response should have this id.
827 int request_id;
828
829 // The origin doing the initiating.
830 GURL origin_url;
831
832 // The requested FileSystem type.
833 WebKit::WebFileSystem::Type type;
834
835 // Indicates how much storage space (in bytes) the caller expects to need.
836 int64 requested_size;
837 };
838
839 namespace IPC {
840
841 class Message;
842
843 // Traits for ViewMsg_Navigate_Params structure to pack/unpack.
844 template <>
845 struct ParamTraits<ViewMsg_Navigate_Params> {
846 typedef ViewMsg_Navigate_Params param_type;
847 static void Write(Message* m, const param_type& p);
848 static bool Read(const Message* m, void** iter, param_type* p);
849 static void Log(const param_type& p, std::string* l);
850 };
851
852 template <>
853 struct ParamTraits<ViewMsg_AudioStreamState_Params> {
854 typedef ViewMsg_AudioStreamState_Params param_type;
855 static void Write(Message* m, const param_type& p);
856 static bool Read(const Message* m, void** iter, param_type* p);
857 static void Log(const param_type& p, std::string* l);
858 };
859
860 template <>
861 struct ParamTraits<ViewMsg_StopFinding_Params> {
862 typedef ViewMsg_StopFinding_Params param_type;
863 static void Write(Message* m, const param_type& p);
864 static bool Read(const Message* m, void** iter, param_type* p);
865 static void Log(const param_type& p, std::string* l);
866 };
867
868 template <>
869 struct ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params> {
870 typedef ViewHostMsg_GetSearchProviderInstallState_Params param_type;
871 static void Write(Message* m, const param_type& p);
872 static bool Read(const Message* m, void** iter, param_type* p);
873 static void Log(const param_type& p, std::string* l);
874 };
875
876 template <>
877 struct ParamTraits<ViewHostMsg_FrameNavigate_Params> {
878 typedef ViewHostMsg_FrameNavigate_Params param_type;
879 static void Write(Message* m, const param_type& p);
880 static bool Read(const Message* m, void** iter, param_type* p);
881 static void Log(const param_type& p, std::string* l);
882 };
883
884 template <>
885 struct ParamTraits<ViewHostMsg_UpdateRect_Params> {
886 typedef ViewHostMsg_UpdateRect_Params param_type;
887 static void Write(Message* m, const param_type& p);
888 static bool Read(const Message* m, void** iter, param_type* p);
889 static void Log(const param_type& p, std::string* l);
890 };
891
892 template <>
893 struct ParamTraits<ViewMsg_ClosePage_Params> {
894 typedef ViewMsg_ClosePage_Params param_type;
895 static void Write(Message* m, const param_type& p);
896 static bool Read(const Message* m, void** iter, param_type* r);
897 static void Log(const param_type& p, std::string* l);
898 };
899
900 template <>
901 struct ParamTraits<ViewHostMsg_Resource_Request> {
902 typedef ViewHostMsg_Resource_Request param_type;
903 static void Write(Message* m, const param_type& p);
904 static bool Read(const Message* m, void** iter, param_type* r);
905 static void Log(const param_type& p, std::string* l);
906 };
907
908 template <>
909 struct ParamTraits<ViewMsg_Print_Params> {
910 typedef ViewMsg_Print_Params param_type;
911 static void Write(Message* m, const param_type& p);
912 static bool Read(const Message* m, void** iter, param_type* p);
913 static void Log(const param_type& p, std::string* l);
914 };
915
916 template <>
917 struct ParamTraits<ViewMsg_PrintPage_Params> {
918 typedef ViewMsg_PrintPage_Params param_type;
919 static void Write(Message* m, const param_type& p);
920 static bool Read(const Message* m, void** iter, param_type* p);
921 static void Log(const param_type& p, std::string* l);
922 };
923
924 template <>
925 struct ParamTraits<ViewMsg_PrintPages_Params> {
926 typedef ViewMsg_PrintPages_Params param_type;
927 static void Write(Message* m, const param_type& p);
928 static bool Read(const Message* m, void** iter, param_type* p);
929 static void Log(const param_type& p, std::string* l);
930 };
931
932 template <>
933 struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
934 typedef ViewHostMsg_DidPrintPage_Params param_type;
935 static void Write(Message* m, const param_type& p);
936 static bool Read(const Message* m, void** iter, param_type* p);
937 static void Log(const param_type& p, std::string* l);
938 };
939
940 template <>
941 struct ParamTraits<ViewHostMsg_Audio_CreateStream_Params> {
942 typedef ViewHostMsg_Audio_CreateStream_Params param_type;
943 static void Write(Message* m, const param_type& p);
944 static bool Read(const Message* m, void** iter, param_type* p);
945 static void Log(const param_type& p, std::string* l);
946 };
947
948 template <>
949 struct ParamTraits<ViewHostMsg_ShowPopup_Params> {
950 typedef ViewHostMsg_ShowPopup_Params param_type;
951 static void Write(Message* m, const param_type& p);
952 static bool Read(const Message* m, void** iter, param_type* p);
953 static void Log(const param_type& p, std::string* l);
954 };
955
956 template <>
957 struct ParamTraits<ViewHostMsg_ScriptedPrint_Params> {
958 typedef ViewHostMsg_ScriptedPrint_Params param_type;
959 static void Write(Message* m, const param_type& p);
960 static bool Read(const Message* m, void** iter, param_type* p);
961 static void Log(const param_type& p, std::string* l);
962 };
963
964 template <>
965 struct ParamTraits<ViewMsg_DOMStorageEvent_Params> {
966 typedef ViewMsg_DOMStorageEvent_Params param_type;
967 static void Write(Message* m, const param_type& p);
968 static bool Read(const Message* m, void** iter, param_type* p);
969 static void Log(const param_type& p, std::string* l);
970 };
971
972 template <>
973 struct ParamTraits<ViewHostMsg_IDBFactoryOpen_Params> {
974 typedef ViewHostMsg_IDBFactoryOpen_Params param_type;
975 static void Write(Message* m, const param_type& p);
976 static bool Read(const Message* m, void** iter, param_type* p);
977 static void Log(const param_type& p, std::string* l);
978 };
979
980 template <>
981 struct ParamTraits<ViewHostMsg_IDBDatabaseCreateObjectStore_Params> {
982 typedef ViewHostMsg_IDBDatabaseCreateObjectStore_Params param_type;
983 static void Write(Message* m, const param_type& p);
984 static bool Read(const Message* m, void** iter, param_type* p);
985 static void Log(const param_type& p, std::string* l);
986 };
987
988 template <>
989 struct ParamTraits<ViewHostMsg_IDBObjectStoreCreateIndex_Params> {
990 typedef ViewHostMsg_IDBObjectStoreCreateIndex_Params param_type;
991 static void Write(Message* m, const param_type& p);
992 static bool Read(const Message* m, void** iter, param_type* p);
993 static void Log(const param_type& p, std::string* l);
994 };
995
996 template <>
997 struct ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params> {
998 typedef ViewHostMsg_IDBObjectStoreOpenCursor_Params param_type;
999 static void Write(Message* m, const param_type& p);
1000 static bool Read(const Message* m, void** iter, param_type* p);
1001 static void Log(const param_type& p, std::string* l);
1002 };
1003
1004 template<>
1005 struct ParamTraits<ViewMsg_ExecuteCode_Params> {
1006 typedef ViewMsg_ExecuteCode_Params param_type;
1007 static void Write(Message* m, const param_type& p);
1008 static bool Read(const Message* m, void** iter, param_type* p);
1009 static void Log(const param_type& p, std::string* l);
1010 };
1011
1012 template <>
1013 struct ParamTraits<ViewHostMsg_CreateWorker_Params> {
1014 typedef ViewHostMsg_CreateWorker_Params param_type;
1015 static void Write(Message* m, const param_type& p);
1016 static bool Read(const Message* m, void** iter, param_type* p);
1017 static void Log(const param_type& p, std::string* l);
1018 };
1019
1020 template <>
1021 struct ParamTraits<ViewHostMsg_ShowNotification_Params> {
1022 typedef ViewHostMsg_ShowNotification_Params param_type;
1023 static void Write(Message* m, const param_type& p);
1024 static bool Read(const Message* m, void** iter, param_type* p);
1025 static void Log(const param_type &p, std::string* l);
1026 };
1027
1028 template<>
1029 struct ParamTraits<ViewMsg_New_Params> {
1030 typedef ViewMsg_New_Params param_type;
1031 static void Write(Message* m, const param_type& p);
1032 static bool Read(const Message* m, void** iter, param_type* p);
1033 static void Log(const param_type& p, std::string* l);
1034 };
1035
1036 template<>
1037 struct ParamTraits<ViewHostMsg_CreateWindow_Params> {
1038 typedef ViewHostMsg_CreateWindow_Params param_type;
1039 static void Write(Message* m, const param_type& p);
1040 static bool Read(const Message* m, void** iter, param_type* p);
1041 static void Log(const param_type& p, std::string* l);
1042 };
1043
1044 template<>
1045 struct ParamTraits<ViewHostMsg_RunFileChooser_Params> {
1046 typedef ViewHostMsg_RunFileChooser_Params param_type;
1047 static void Write(Message* m, const param_type& p);
1048 static bool Read(const Message* m, void** iter, param_type* p);
1049 static void Log(const param_type& p, std::string* l);
1050 };
1051
1052 template <>
1053 struct ParamTraits<ViewMsg_ExtensionExtentInfo> {
1054 typedef ViewMsg_ExtensionExtentInfo param_type;
1055 static void Write(Message* m, const param_type& p);
1056 static bool Read(const Message* m, void** iter, param_type* p);
1057 static void Log(const param_type& p, std::string* l);
1058 };
1059
1060 template <>
1061 struct ParamTraits<ViewMsg_ExtensionExtentsUpdated_Params> {
1062 typedef ViewMsg_ExtensionExtentsUpdated_Params param_type;
1063 static void Write(Message* m, const param_type& p);
1064 static bool Read(const Message* m, void** iter, param_type* p);
1065 static void Log(const param_type& p, std::string* l);
1066 };
1067
1068 template <>
1069 struct ParamTraits<ViewMsg_DeviceOrientationUpdated_Params> {
1070 typedef ViewMsg_DeviceOrientationUpdated_Params param_type;
1071 static void Write(Message* m, const param_type& p);
1072 static bool Read(const Message* m, void** iter, param_type* p);
1073 static void Log(const param_type& p, std::string* l);
1074 };
1075
1076 template <>
1077 struct ParamTraits<ViewHostMsg_DomMessage_Params> {
1078 typedef ViewHostMsg_DomMessage_Params param_type;
1079 static void Write(Message* m, const param_type& p);
1080 static bool Read(const Message* m, void** iter, param_type* p);
1081 static void Log(const param_type& p, std::string* l);
1082 };
1083
1084 template <>
1085 struct ParamTraits<ViewHostMsg_OpenFileSystemRequest_Params> {
1086 typedef ViewHostMsg_OpenFileSystemRequest_Params param_type;
1087 static void Write(Message* m, const param_type& p);
1088 static bool Read(const Message* m, void** iter, param_type* p);
1089 static void Log(const param_type& p, std::string* l);
1090 };
1091
1092 } // namespace IPC
1093
1094 #endif // CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages.cc ('k') | chrome/common/render_messages_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698