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

Unified Diff: webkit/glue/context_node_types.h

Issue 16510: Fixes bug 1925 (context menus for text selections in... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/context_menu_client_impl.cc ('k') | webkit/glue/webview_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/context_node_types.h
===================================================================
--- webkit/glue/context_node_types.h (revision 8273)
+++ webkit/glue/context_node_types.h (working copy)
@@ -8,45 +8,35 @@
#include "base/basictypes.h"
#include "base/logging.h"
-// This class is for scoping only.
-class ContextNode {
- public:
- // This enumeration defines the type of node that the user may perform a
- // contextual action on in the WebView.
- enum Type {
-
+// The type of node that the user may perform a contextual action on
+// in the WebView.
+struct ContextNode {
+ enum TypeBit {
// No node is selected
- NONE = 0,
+ NONE = 0x0,
// The top page is selected
- PAGE = 1,
+ PAGE = 0x1,
// A subframe page is selected
- FRAME = 2,
+ FRAME = 0x2,
// A link is selected
- LINK = 3,
+ LINK = 0x4,
// An image is selected
- IMAGE = 4,
+ IMAGE = 0x8,
- // An image that is also a link is selected
- IMAGE_LINK = 5,
-
// There is a textual or mixed selection that is selected
- SELECTION = 6,
+ SELECTION = 0x10,
- // An editiable element is selected
- EDITABLE = 7,
+ // An editable element is selected
+ EDITABLE = 0x20,
// A misspelled word is selected
- MISPELLED_WORD = 8
+ MISSPELLED_WORD = 0x40,
};
- static Type FromInt(int32 type) {
- return static_cast<Type>(type);
- }
-
enum Capability {
CAN_DO_NONE = 0x0,
CAN_UNDO = 0x1,
@@ -57,6 +47,10 @@
CAN_DELETE = 0x20,
CAN_SELECT_ALL = 0x40,
};
+
+ int32 type;
+ ContextNode() : type(NONE) {}
+ explicit ContextNode(int32 t) : type(t) {}
};
#endif // WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
« no previous file with comments | « webkit/glue/context_menu_client_impl.cc ('k') | webkit/glue/webview_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698