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

Side by Side Diff: sky/engine/public/web/WebContextMenuData.h

Issue 640143004: Remove context menus. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/platform/RuntimeEnabledFeatures.in ('k') | sky/engine/public/web/WebFrameClient.h » ('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 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef WebContextMenuData_h
32 #define WebContextMenuData_h
33
34 #include "../platform/WebPoint.h"
35 #include "../platform/WebReferrerPolicy.h"
36 #include "../platform/WebString.h"
37 #include "../platform/WebURL.h"
38 #include "../platform/WebVector.h"
39 #include "WebMenuItemInfo.h"
40 #include "WebNode.h"
41
42 #define WEBCONTEXT_MEDIATYPEFILE_DEFINED
43
44 namespace blink {
45
46 // This struct is passed to WebViewClient::ShowContextMenu.
47 struct WebContextMenuData {
48 enum MediaType {
49 // No special node is in context.
50 MediaTypeNone,
51 // An image node is selected.
52 MediaTypeImage,
53 // A video node is selected.
54 MediaTypeVideo,
55 // An audio node is selected.
56 MediaTypeAudio,
57 // A canvas node is selected.
58 MediaTypeCanvas,
59 // A file node is selected.
60 MediaTypeFile,
61 // A plugin node is selected.
62 MediaTypePlugin,
63 MediaTypeLast = MediaTypePlugin
64 };
65 // The type of media the context menu is being invoked on.
66 MediaType mediaType;
67
68 // The x and y position of the mouse pointer (relative to the webview).
69 WebPoint mousePosition;
70
71 // The absolute URL of the link that is in context.
72 WebURL linkURL;
73
74 // The absolute URL of the image/video/audio that is in context.
75 WebURL srcURL;
76
77 // Whether the image in context is a null.
78 bool hasImageContents;
79
80 // The absolute URL of the page in context.
81 WebURL pageURL;
82
83 // The absolute keyword search URL including the %s search tag when the
84 // "Add as search engine..." option is clicked (left empty if not used).
85 WebURL keywordURL;
86
87 // The absolute URL of the subframe in context.
88 WebURL frameURL;
89
90 // The encoding for the frame in context.
91 WebString frameEncoding;
92
93 enum MediaFlags {
94 MediaNone = 0x0,
95 MediaInError = 0x1,
96 MediaPaused = 0x2,
97 MediaMuted = 0x4,
98 MediaLoop = 0x8,
99 MediaCanSave = 0x10,
100 MediaHasAudio = 0x20,
101 MediaCanToggleControls = 0x40,
102 MediaControls = 0x80,
103 MediaCanPrint = 0x100,
104 MediaCanRotate = 0x200,
105 };
106
107 // Extra attributes describing media elements.
108 int mediaFlags;
109
110 // The raw text of the selection in context.
111 WebString selectedText;
112
113 // Whether spell checking is enabled.
114 bool isSpellCheckingEnabled;
115
116 // Suggested filename for saving file.
117 WebString suggestedFilename;
118
119 // The editable (possibily) misspelled word.
120 WebString misspelledWord;
121
122 // The identifier of the misspelling.
123 uint32_t misspellingHash;
124
125 // If misspelledWord is not empty, holds suggestions from the dictionary.
126 WebVector<WebString> dictionarySuggestions;
127
128 // Whether context is editable.
129 bool isEditable;
130
131 enum CheckableMenuItemFlags {
132 CheckableMenuItemDisabled = 0x0,
133 CheckableMenuItemEnabled = 0x1,
134 CheckableMenuItemChecked = 0x2,
135 };
136
137 // Writing direction menu items - values are unions of
138 // CheckableMenuItemFlags.
139 int writingDirectionDefault;
140 int writingDirectionLeftToRight;
141 int writingDirectionRightToLeft;
142
143 enum EditFlags {
144 CanDoNone = 0x0,
145 CanUndo = 0x1,
146 CanRedo = 0x2,
147 CanCut = 0x4,
148 CanCopy = 0x8,
149 CanPaste = 0x10,
150 CanDelete = 0x20,
151 CanSelectAll = 0x40,
152 CanTranslate = 0x80,
153 };
154
155 // Which edit operations are available in the context.
156 int editFlags;
157
158 // Security information for the context.
159 WebCString securityInfo;
160
161 // The referrer policy applicable to this context.
162 WebReferrerPolicy referrerPolicy;
163
164 // Custom context menu items provided by the WebCore internals.
165 WebVector<WebMenuItemInfo> customItems;
166
167 // The node that was clicked.
168 WebNode node;
169
170 WebContextMenuData()
171 : mediaType(MediaTypeNone)
172 , hasImageContents(true)
173 , mediaFlags(MediaNone)
174 , isSpellCheckingEnabled(false)
175 , misspellingHash(0)
176 , isEditable(false)
177 , writingDirectionDefault(CheckableMenuItemDisabled)
178 , writingDirectionLeftToRight(CheckableMenuItemEnabled)
179 , writingDirectionRightToLeft(CheckableMenuItemEnabled)
180 , editFlags(0) { }
181 };
182
183 } // namespace blink
184
185 #endif
OLDNEW
« no previous file with comments | « sky/engine/platform/RuntimeEnabledFeatures.in ('k') | sky/engine/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698