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

Unified Diff: third_party/WebKit/Source/core/layout/api/SelectionState.h

Issue 2732643004: Add operator<< to SelectionState for debug logging. (Closed)
Patch Set: Use FOR_EACH pattern and add test. Created 3 years, 9 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
Index: third_party/WebKit/Source/core/layout/api/SelectionState.h
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.h b/third_party/WebKit/Source/core/layout/api/SelectionState.h
index 728e4c540caeb0510a44baa014d9ce066b59ec39..30b6d3759e629d284a0313c9c861dc30c3d4c2f6 100644
--- a/third_party/WebKit/Source/core/layout/api/SelectionState.h
+++ b/third_party/WebKit/Source/core/layout/api/SelectionState.h
@@ -5,24 +5,34 @@
#ifndef SelectionState_h
#define SelectionState_h
+#include <iosfwd>
+#include "core/CoreExport.h"
+
namespace blink {
+#define FOR_EACH_SELECTION_STATE(V) \
+ /* The object is not selected. */ \
+ V(None) \
+ /* The object either contains the start of a selection run or is the */ \
+ /* start of a run. */ \
+ V(Start) \
+ /* The object is fully encompassed by a selection run. */ \
+ V(Inside) \
+ /* The object either contains the end of a selection run or is the */ \
+ /* end of a run. */ \
+ V(End) \
+ /* The object contains an entire run or is the sole selected object */ \
+ /* in that run. */ \
+ V(Both)
+
enum SelectionState {
- // The object is not selected.
- SelectionNone,
- // The object either contains the start of a selection run or is the start of
- // a run.
- SelectionStart,
- // The object is fully encompassed by a selection run.
- SelectionInside,
- // The object either contains the end of a selection run or is the end of a
- // run.
- SelectionEnd,
- // The object contains an entire run or is the sole selected object in that
- // run.
- SelectionBoth
+#define V(state) Selection##state,
+ FOR_EACH_SELECTION_STATE(V)
+#undef V
};
+CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionState);
+
} // namespace blink
#endif // SelectionState_h
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/api/SelectionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698