1 // Copyright 2014 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.
5 #include "extensions/browser/guest_view/web_view/web_view_constants.h"
10 const char kAttributeAllowTransparency
[] = "allowtransparency";
11 const char kAttributeAllowScaling
[] = "allowscaling";
12 const char kAttributeName
[] = "name";
13 const char kAttributeSrc
[] = "src";
16 const char kAPINamespace
[] = "webViewInternal";
18 // API error messages.
19 const char kAPILoadDataInvalidDataURL
[] = "Invalid data URL \"%s\".";
20 const char kAPILoadDataInvalidBaseURL
[] = "Invalid base URL \"%s\".";
21 const char kAPILoadDataInvalidVirtualURL
[] = "Invalid virtual URL \"%s\".";
24 const char kEventClose
[] = "webViewInternal.onClose";
25 const char kEventConsoleMessage
[] = "webViewInternal.onConsoleMessage";
26 const char kEventContentLoad
[] = "webViewInternal.onContentLoad";
27 const char kEventContextMenuShow
[] = "chromeWebViewInternal.onContextMenuShow";
28 const char kEventDialog
[] = "webViewInternal.onDialog";
29 const char kEventDropLink
[] = "webViewInternal.onDropLink";
30 const char kEventExit
[] = "webViewInternal.onExit";
31 const char kEventExitFullscreen
[] = "webViewInternal.onExitFullscreen";
32 const char kEventFindReply
[] = "webViewInternal.onFindReply";
33 const char kEventFrameNameChanged
[] = "webViewInternal.onFrameNameChanged";
34 const char kEventHeadersReceived
[] = "webViewInternal.onHeadersReceived";
35 const char kEventLoadAbort
[] = "webViewInternal.onLoadAbort";
36 const char kEventLoadCommit
[] = "webViewInternal.onLoadCommit";
37 const char kEventLoadProgress
[] = "webViewInternal.onLoadProgress";
38 const char kEventLoadRedirect
[] = "webViewInternal.onLoadRedirect";
39 const char kEventLoadStart
[] = "webViewInternal.onLoadStart";
40 const char kEventLoadStop
[] = "webViewInternal.onLoadStop";
41 const char kEventMessage
[] = "webViewInternal.onMessage";
42 const char kEventNewWindow
[] = "webViewInternal.onNewWindow";
43 const char kEventPermissionRequest
[] = "webViewInternal.onPermissionRequest";
44 const char kEventResponseStarted
[] = "webViewInternal.onResponseStarted";
45 const char kEventResponsive
[] = "webViewInternal.onResponsive";
46 const char kEventSizeChanged
[] = "webViewInternal.onSizeChanged";
47 const char kEventUnresponsive
[] = "webViewInternal.onUnresponsive";
48 const char kEventZoomChange
[] = "webViewInternal.onZoomChange";
50 // WebRequest API events.
51 const char kEventAuthRequired
[] = "webViewInternal.onAuthRequired";
52 const char kEventBeforeRedirect
[] = "webViewInternal.onBeforeRedirect";
53 const char kEventBeforeRequest
[] = "webViewInternal.onBeforeRequest";
54 const char kEventBeforeSendHeaders
[] = "webViewInternal.onBeforeSendHeaders";
55 const char kEventCompleted
[] = "webViewInternal.onCompleted";
56 const char kEventErrorOccurred
[] = "webViewInternal.onErrorOccurred";
57 const char kEventSendHeaders
[] = "webViewInternal.onSendHeaders";
59 // Event related constants.
60 const char kWebViewEventPrefix
[] = "webViewInternal.";
62 // Parameters/properties on events.
63 const char kContextMenuItems
[] = "items";
64 const char kDefaultPromptText
[] = "defaultPromptText";
65 const char kFindSearchText
[] = "searchText";
66 const char kFindFinalUpdate
[] = "finalUpdate";
67 const char kInitialHeight
[] = "initialHeight";
68 const char kInitialWidth
[] = "initialWidth";
69 const char kLastUnlockedBySelf
[] = "lastUnlockedBySelf";
70 const char kLevel
[] = "level";
71 const char kLine
[] = "line";
72 const char kMessage
[] = "message";
73 const char kMessageText
[] = "messageText";
74 const char kMessageType
[] = "messageType";
75 const char kName
[] = "name";
76 const char kNewHeight
[] = "newHeight";
77 const char kNewURL
[] = "newUrl";
78 const char kNewWidth
[] = "newWidth";
79 const char kOldHeight
[] = "oldHeight";
80 const char kOldURL
[] = "oldUrl";
81 const char kOrigin
[] = "origin";
82 const char kPermission
[] = "permission";
83 const char kPermissionTypeDialog
[] = "dialog";
84 const char kPermissionTypeDownload
[] = "download";
85 const char kPermissionTypeFileSystem
[] = "filesystem";
86 const char kPermissionTypeFullscreen
[] = "fullscreen";
87 const char kPermissionTypeGeolocation
[] = "geolocation";
88 const char kPermissionTypeLoadPlugin
[] = "loadplugin";
89 const char kPermissionTypeMedia
[] = "media";
90 const char kPermissionTypeNewWindow
[] = "newwindow";
91 const char kPermissionTypePointerLock
[] = "pointerLock";
92 const char kOldWidth
[] = "oldWidth";
93 const char kProcessId
[] = "processId";
94 const char kProgress
[] = "progress";
95 const char kReason
[] = "reason";
96 const char kRequestId
[] = "requestId";
97 const char kRequestInfo
[] = "requestInfo";
98 const char kSourceId
[] = "sourceId";
99 const char kTargetURL
[] = "targetUrl";
100 const char kWindowID
[] = "windowId";
101 const char kWindowOpenDisposition
[] = "windowOpenDisposition";
102 const char kOldZoomFactor
[] = "oldZoomFactor";
103 const char kNewZoomFactor
[] = "newZoomFactor";
105 // Internal parameters/properties on events.
106 const char kInternalBaseURLForDataURL
[] = "baseUrlForDataUrl";
107 const char kInternalCurrentEntryIndex
[] = "currentEntryIndex";
108 const char kInternalEntryCount
[] = "entryCount";
109 const char kInternalProcessId
[] = "processId";
111 // Parameters to callback functions.
112 const char kFindNumberOfMatches
[] = "numberOfMatches";
113 const char kFindActiveMatchOrdinal
[] = "activeMatchOrdinal";
114 const char kFindSelectionRect
[] = "selectionRect";
115 const char kFindRectLeft
[] = "left";
116 const char kFindRectTop
[] = "top";
117 const char kFindRectWidth
[] = "width";
118 const char kFindRectHeight
[] = "height";
119 const char kFindCanceled
[] = "canceled";
121 // Initialization parameters.
122 const char kInitialZoomFactor
[] = "initialZoomFactor";
123 const char kParameterUserAgentOverride
[] = "userAgentOverride";
126 const char kMenuItemCommandId
[] = "commandId";
127 const char kMenuItemLabel
[] = "label";
128 const char kPersistPrefix
[] = "persist:";
129 const char kStoragePartitionId
[] = "partition";
130 const unsigned int kMaxOutstandingPermissionRequests
= 1024;
131 const int kInvalidPermissionRequestID
= 0;
133 // ClearData API constants.
134 const uint32 WEB_VIEW_REMOVE_DATA_MASK_APPCACHE
= 1 << 0;
135 const uint32 WEB_VIEW_REMOVE_DATA_MASK_CACHE
= 1 << 1;
136 const uint32 WEB_VIEW_REMOVE_DATA_MASK_COOKIES
= 1 << 2;
137 const uint32 WEB_VIEW_REMOVE_DATA_MASK_FILE_SYSTEMS
= 1 << 3;
138 const uint32 WEB_VIEW_REMOVE_DATA_MASK_INDEXEDDB
= 1 << 4;
139 const uint32 WEB_VIEW_REMOVE_DATA_MASK_LOCAL_STORAGE
= 1 << 5;
140 const uint32 WEB_VIEW_REMOVE_DATA_MASK_WEBSQL
= 1 << 6;
143 const char kWebViewContentScriptManagerKeyName
[] =
144 "web_view_content_script_manager";
145 } // namespace webview