15c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Copyright 2014 The Chromium Authors. All rights reserved.
2eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Use of this source code is governed by a BSD-style license that can be
3eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// found in the LICENSE file.
4eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "extensions/browser/guest_view/web_view/web_view_constants.h"
6eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
7eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochnamespace webview {
8eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Attributes.
101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kAttributeAllowTransparency[] = "allowtransparency";
115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)const char kAttributeAutoSize[] = "autosize";
125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)const char kAttributeMaxHeight[] = "maxheight";
135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)const char kAttributeMaxWidth[] = "maxwidth";
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)const char kAttributeMinHeight[] = "minheight";
155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)const char kAttributeMinWidth[] = "minwidth";
161320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kAttributeName[] = "name";
171320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kAttributeSrc[] = "src";
185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// API namespace.
206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)const char kAPINamespace[] = "webViewInternal";
216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Events.
23116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventClose[] = "webViewInternal.onClose";
24116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventConsoleMessage[] = "webViewInternal.onConsoleMessage";
25116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventContentLoad[] = "webViewInternal.onContentLoad";
261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kEventContextMenu[] = "chromeWebViewInternal.contextmenu";
27116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventDialog[] = "webViewInternal.onDialog";
28116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventExit[] = "webViewInternal.onExit";
29116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventFindReply[] = "webViewInternal.onFindReply";
30116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventFrameNameChanged[] = "webViewInternal.onFrameNameChanged";
31116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadAbort[] = "webViewInternal.onLoadAbort";
32116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadCommit[] = "webViewInternal.onLoadCommit";
33116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadProgress[] = "webViewInternal.onLoadProgress";
34116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadRedirect[] = "webViewInternal.onLoadRedirect";
35116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadStart[] = "webViewInternal.onLoadStart";
36116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventLoadStop[] = "webViewInternal.onLoadStop";
37116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventMessage[] = "webViewInternal.onMessage";
38116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventNewWindow[] = "webViewInternal.onNewWindow";
39116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventPermissionRequest[] = "webViewInternal.onPermissionRequest";
401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kEventPluginDestroyed[] = "webViewInternal.onPluginDestroyed";
41116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventResponsive[] = "webViewInternal.onResponsive";
42116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventSizeChanged[] = "webViewInternal.onSizeChanged";
43116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventUnresponsive[] = "webViewInternal.onUnresponsive";
44116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kEventZoomChange[] = "webViewInternal.onZoomChange";
45116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
46116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Event related constants.
47116680a4aac90f2aa7413d9095a592090648e557Ben Murdochconst char kWebViewEventPrefix[] = "webViewInternal.";
48eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
497dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch// Parameters/properties on events.
50010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)const char kContextMenuItems[] = "items";
510529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochconst char kDefaultPromptText[] = "defaultPromptText";
52a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindSearchText[] = "searchText";
53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindFinalUpdate[] = "finalUpdate";
54cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kInitialHeight[] = "initialHeight";
55cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kInitialWidth[] = "initialWidth";
560529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochconst char kLastUnlockedBySelf[] = "lastUnlockedBySelf";
577dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kLevel[] = "level";
587dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kLine[] = "line";
597dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kMessage[] = "message";
600529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochconst char kMessageText[] = "messageText";
610529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochconst char kMessageType[] = "messageType";
62cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kName[] = "name";
633551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)const char kNewHeight[] = "newHeight";
647dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kNewURL[] = "newUrl";
653551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)const char kNewWidth[] = "newWidth";
663551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)const char kOldHeight[] = "oldHeight";
677dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kOldURL[] = "oldUrl";
68c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermission[] = "permission";
69c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypeDialog[] = "dialog";
70c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypeDownload[] = "download";
71f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)const char kPermissionTypeFileSystem[] = "filesystem";
72c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypeGeolocation[] = "geolocation";
734e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)const char kPermissionTypeLoadPlugin[] = "loadplugin";
74c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypeMedia[] = "media";
75c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypeNewWindow[] = "newwindow";
76c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kPermissionTypePointerLock[] = "pointerLock";
773551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)const char kOldWidth[] = "oldWidth";
787dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kProcessId[] = "processId";
7958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)const char kProgress[] = "progress";
807dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kReason[] = "reason";
81c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdochconst char kRequestId[] = "requestId";
827dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochconst char kSourceId[] = "sourceId";
83cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kTargetURL[] = "targetUrl";
84cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kWindowID[] = "windowId";
85cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)const char kWindowOpenDisposition[] = "windowOpenDisposition";
865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)const char kOldZoomFactor[] = "oldZoomFactor";
875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)const char kNewZoomFactor[] = "newZoomFactor";
887dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
89eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Internal parameters/properties on events.
901320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst char kInternalBaseURLForDataURL[] = "baseUrlForDataUrl";
91eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochconst char kInternalCurrentEntryIndex[] = "currentEntryIndex";
92eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochconst char kInternalEntryCount[] = "entryCount";
93eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochconst char kInternalProcessId[] = "processId";
94eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
95a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Parameters to callback functions.
96a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindNumberOfMatches[] = "numberOfMatches";
97a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindActiveMatchOrdinal[] = "activeMatchOrdinal";
98a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindSelectionRect[] = "selectionRect";
99a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindRectLeft[] = "left";
100a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindRectTop[] = "top";
101a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindRectWidth[] = "width";
102a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindRectHeight[] = "height";
103a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const char kFindCanceled[] = "canceled";
104a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
10568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)// Initialization parameters.
10668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)const char kParameterUserAgentOverride[] = "userAgentOverride";
10768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)
108a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Miscellaneous.
109010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)const char kMenuItemCommandId[] = "commandId";
110010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)const char kMenuItemLabel[] = "label";
111f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)const char kPersistPrefix[] = "persist:";
112f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)const char kStoragePartitionId[] = "storagePartitionId";
1134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)const unsigned int kMaxOutstandingPermissionRequests = 1024;
114a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochconst int kInvalidPermissionRequestID = 0;
1154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
116eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch}  // namespace webview
117