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