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.
4
5#include "extensions/browser/guest_view/web_view/web_view_constants.h"
6
7namespace webview {
8
9// Attributes.
10const char kAttributeAllowTransparency[] = "allowtransparency";
11const char kAttributeAutoSize[] = "autosize";
12const char kAttributeMaxHeight[] = "maxheight";
13const char kAttributeMaxWidth[] = "maxwidth";
14const char kAttributeMinHeight[] = "minheight";
15const char kAttributeMinWidth[] = "minwidth";
16const char kAttributeName[] = "name";
17const char kAttributeSrc[] = "src";
18
19// API namespace.
20const char kAPINamespace[] = "webViewInternal";
21
22// Events.
23const char kEventClose[] = "webViewInternal.onClose";
24const char kEventConsoleMessage[] = "webViewInternal.onConsoleMessage";
25const char kEventContentLoad[] = "webViewInternal.onContentLoad";
26const char kEventContextMenu[] = "chromeWebViewInternal.contextmenu";
27const char kEventDialog[] = "webViewInternal.onDialog";
28const char kEventExit[] = "webViewInternal.onExit";
29const char kEventFindReply[] = "webViewInternal.onFindReply";
30const char kEventFrameNameChanged[] = "webViewInternal.onFrameNameChanged";
31const char kEventLoadAbort[] = "webViewInternal.onLoadAbort";
32const char kEventLoadCommit[] = "webViewInternal.onLoadCommit";
33const char kEventLoadProgress[] = "webViewInternal.onLoadProgress";
34const char kEventLoadRedirect[] = "webViewInternal.onLoadRedirect";
35const char kEventLoadStart[] = "webViewInternal.onLoadStart";
36const char kEventLoadStop[] = "webViewInternal.onLoadStop";
37const char kEventMessage[] = "webViewInternal.onMessage";
38const char kEventNewWindow[] = "webViewInternal.onNewWindow";
39const char kEventPermissionRequest[] = "webViewInternal.onPermissionRequest";
40const char kEventPluginDestroyed[] = "webViewInternal.onPluginDestroyed";
41const char kEventResponsive[] = "webViewInternal.onResponsive";
42const char kEventSizeChanged[] = "webViewInternal.onSizeChanged";
43const char kEventUnresponsive[] = "webViewInternal.onUnresponsive";
44const char kEventZoomChange[] = "webViewInternal.onZoomChange";
45
46// Event related constants.
47const char kWebViewEventPrefix[] = "webViewInternal.";
48
49// Parameters/properties on events.
50const char kContextMenuItems[] = "items";
51const char kDefaultPromptText[] = "defaultPromptText";
52const char kFindSearchText[] = "searchText";
53const char kFindFinalUpdate[] = "finalUpdate";
54const char kInitialHeight[] = "initialHeight";
55const char kInitialWidth[] = "initialWidth";
56const char kLastUnlockedBySelf[] = "lastUnlockedBySelf";
57const char kLevel[] = "level";
58const char kLine[] = "line";
59const char kMessage[] = "message";
60const char kMessageText[] = "messageText";
61const char kMessageType[] = "messageType";
62const char kName[] = "name";
63const char kNewHeight[] = "newHeight";
64const char kNewURL[] = "newUrl";
65const char kNewWidth[] = "newWidth";
66const char kOldHeight[] = "oldHeight";
67const char kOldURL[] = "oldUrl";
68const char kPermission[] = "permission";
69const char kPermissionTypeDialog[] = "dialog";
70const char kPermissionTypeDownload[] = "download";
71const char kPermissionTypeFileSystem[] = "filesystem";
72const char kPermissionTypeGeolocation[] = "geolocation";
73const char kPermissionTypeLoadPlugin[] = "loadplugin";
74const char kPermissionTypeMedia[] = "media";
75const char kPermissionTypeNewWindow[] = "newwindow";
76const char kPermissionTypePointerLock[] = "pointerLock";
77const char kOldWidth[] = "oldWidth";
78const char kProcessId[] = "processId";
79const char kProgress[] = "progress";
80const char kReason[] = "reason";
81const char kRequestId[] = "requestId";
82const char kSourceId[] = "sourceId";
83const char kTargetURL[] = "targetUrl";
84const char kWindowID[] = "windowId";
85const char kWindowOpenDisposition[] = "windowOpenDisposition";
86const char kOldZoomFactor[] = "oldZoomFactor";
87const char kNewZoomFactor[] = "newZoomFactor";
88
89// Internal parameters/properties on events.
90const char kInternalBaseURLForDataURL[] = "baseUrlForDataUrl";
91const char kInternalCurrentEntryIndex[] = "currentEntryIndex";
92const char kInternalEntryCount[] = "entryCount";
93const char kInternalProcessId[] = "processId";
94
95// Parameters to callback functions.
96const char kFindNumberOfMatches[] = "numberOfMatches";
97const char kFindActiveMatchOrdinal[] = "activeMatchOrdinal";
98const char kFindSelectionRect[] = "selectionRect";
99const char kFindRectLeft[] = "left";
100const char kFindRectTop[] = "top";
101const char kFindRectWidth[] = "width";
102const char kFindRectHeight[] = "height";
103const char kFindCanceled[] = "canceled";
104
105// Initialization parameters.
106const char kParameterUserAgentOverride[] = "userAgentOverride";
107
108// Miscellaneous.
109const char kMenuItemCommandId[] = "commandId";
110const char kMenuItemLabel[] = "label";
111const char kPersistPrefix[] = "persist:";
112const char kStoragePartitionId[] = "storagePartitionId";
113const unsigned int kMaxOutstandingPermissionRequests = 1024;
114const int kInvalidPermissionRequestID = 0;
115
116}  // namespace webview
117