Built UserAgent according to OS And Product.
[platform/framework/web/crosswalk-tizen.git] / atom / common / mouse_util.cc
1 // Copyright (c) 2015 GitHub, Inc.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
4
5 #include <string>
6 #include "atom/common/mouse_util.h"
7
8 using Cursor = blink::WebCursorInfo::Type;
9
10 namespace atom {
11
12 std::string CursorTypeToString(const content::WebCursor::CursorInfo& info) {
13   switch (info.type) {
14     case Cursor::TypePointer: return "default";
15     case Cursor::TypeCross: return "crosshair";
16     case Cursor::TypeHand: return "pointer";
17     case Cursor::TypeIBeam: return "text";
18     case Cursor::TypeWait: return "wait";
19     case Cursor::TypeHelp: return "help";
20     case Cursor::TypeEastResize: return "e-resize";
21     case Cursor::TypeNorthResize: return "n-resize";
22     case Cursor::TypeNorthEastResize: return "ne-resize";
23     case Cursor::TypeNorthWestResize: return "nw-resize";
24     case Cursor::TypeSouthResize: return "s-resize";
25     case Cursor::TypeSouthEastResize: return "se-resize";
26     case Cursor::TypeSouthWestResize: return "sw-resize";
27     case Cursor::TypeWestResize: return "w-resize";
28     case Cursor::TypeNorthSouthResize: return "ns-resize";
29     case Cursor::TypeEastWestResize: return "ew-resize";
30     case Cursor::TypeNorthEastSouthWestResize: return "nesw-resize";
31     case Cursor::TypeNorthWestSouthEastResize: return "nwse-resize";
32     case Cursor::TypeColumnResize: return "col-resize";
33     case Cursor::TypeRowResize: return "row-resize";
34     case Cursor::TypeMiddlePanning: return "m-panning";
35     case Cursor::TypeEastPanning: return "e-panning";
36     case Cursor::TypeNorthPanning: return "n-panning";
37     case Cursor::TypeNorthEastPanning: return "ne-panning";
38     case Cursor::TypeNorthWestPanning: return "nw-panning";
39     case Cursor::TypeSouthPanning: return "s-panning";
40     case Cursor::TypeSouthEastPanning: return "se-panning";
41     case Cursor::TypeSouthWestPanning: return "sw-panning";
42     case Cursor::TypeWestPanning: return "w-panning";
43     case Cursor::TypeMove: return "move";
44     case Cursor::TypeVerticalText: return "vertical-text";
45     case Cursor::TypeCell: return "cell";
46     case Cursor::TypeContextMenu: return "context-menu";
47     case Cursor::TypeAlias: return "alias";
48     case Cursor::TypeProgress: return "progress";
49     case Cursor::TypeNoDrop: return "nodrop";
50     case Cursor::TypeCopy: return "copy";
51     case Cursor::TypeNone: return "none";
52     case Cursor::TypeNotAllowed: return "not-allowed";
53     case Cursor::TypeZoomIn: return "zoom-in";
54     case Cursor::TypeZoomOut: return "zoom-out";
55     case Cursor::TypeGrab: return "grab";
56     case Cursor::TypeGrabbing: return "grabbing";
57     case Cursor::TypeCustom: return "custom";
58     default: return "default";
59   }
60 }
61
62 }  // namespace atom