Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/api/SelectionState.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f5e7f016bd479fe06f8fe7d6cb61a6b2fec44fa3 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/layout/api/SelectionState.h" |
| + |
| +#include "wtf/Assertions.h" |
| + |
| +namespace blink { |
| + |
| +#ifndef NDEBUG |
| + |
| +std::ostream& operator<<(std::ostream& out, const SelectionState& state) { |
|
yosin_UTC9
2017/03/06 04:51:10
nit: s/const SelectionState&/SelectionState/
|
| + switch (state) { |
| + case SelectionNone: |
|
yosin_UTC9
2017/03/06 04:51:10
How about using FOR_EACH_XXX(V) technique to make
|
| + return out << "None"; |
| + case SelectionStart: |
| + return out << "Start"; |
| + case SelectionInside: |
| + return out << "Inside"; |
| + case SelectionEnd: |
| + return out << "End"; |
| + case SelectionBoth: |
| + return out << "Both"; |
| + default: |
| + NOTREACHED(); |
| + return out << "Unknown"; |
| + } |
| +} |
| + |
| +#endif |
| + |
| +} // namespace blink |