electron/shell/common/mouse_util.cc
Electron Bot d8737734bf
chore: bump chromium to bc8f70ed4cfe2262ea833750eaddb (master) (#22649)
* chore: bump chromium in DEPS to 9321f32fb1b3af8fdfce55c7bbfacf3f75118dca

* Update patches

* Update electron_swiftshader_binaries deps

https://chromium-review.googlesource.com/c/chromium/src/+/2056931

* Use Promise with RequestPointerLock calls

https://chromium-review.googlesource.com/c/chromium/src/+/2069199

* Replace content::CursorInfo with ui::Cursor

https://chromium-review.googlesource.com/c/chromium/src/+/1999201

* Convert MaterialDesignController to a true singleton.

https://chromium-review.googlesource.com/c/chromium/src/+/2090877

* Drop WebContentsView::RenderViewCreated hook

https://chromium-review.googlesource.com/c/chromium/src/+/2093535

* chore: bump chromium in DEPS to 6478123cfa0102ed754c70eb9bbdd391d676a4dd

* Splitting context_menu_params.h into separate browser VS common parts.

https://chromium-review.googlesource.com/c/chromium/src/+/2097468

* Fix DCHECK on OnThemeChanged()

https://chromium-review.googlesource.com/c/chromium/src/+/2090713

* chore: bump chromium in DEPS to b0269bb003f699bc8ea7dcba8b0795ef963696d7

* Remove no longer needed patch

* Check PointerLock requests for new options and update accordingly

https://chromium-review.googlesource.com/c/chromium/src/+/2071788

* Address issues from review

* Fixup compile error

* Add additional library files

* chore: bump chromium in DEPS to a41285fb8aebc8f70ed4cfe2262ea833750eaddb

* Update patches

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-03-14 16:54:14 -04:00

109 lines
2.8 KiB
C++

// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <string>
#include "shell/common/mouse_util.h"
#include "ui/base/mojom/cursor_type.mojom-shared.h"
using Cursor = ui::mojom::CursorType;
namespace electron {
std::string CursorTypeToString(const ui::Cursor& cursor) {
switch (cursor.type()) {
case Cursor::kPointer:
return "default";
case Cursor::kCross:
return "crosshair";
case Cursor::kHand:
return "pointer";
case Cursor::kIBeam:
return "text";
case Cursor::kWait:
return "wait";
case Cursor::kHelp:
return "help";
case Cursor::kEastResize:
return "e-resize";
case Cursor::kNorthResize:
return "n-resize";
case Cursor::kNorthEastResize:
return "ne-resize";
case Cursor::kNorthWestResize:
return "nw-resize";
case Cursor::kSouthResize:
return "s-resize";
case Cursor::kSouthEastResize:
return "se-resize";
case Cursor::kSouthWestResize:
return "sw-resize";
case Cursor::kWestResize:
return "w-resize";
case Cursor::kNorthSouthResize:
return "ns-resize";
case Cursor::kEastWestResize:
return "ew-resize";
case Cursor::kNorthEastSouthWestResize:
return "nesw-resize";
case Cursor::kNorthWestSouthEastResize:
return "nwse-resize";
case Cursor::kColumnResize:
return "col-resize";
case Cursor::kRowResize:
return "row-resize";
case Cursor::kMiddlePanning:
return "m-panning";
case Cursor::kEastPanning:
return "e-panning";
case Cursor::kNorthPanning:
return "n-panning";
case Cursor::kNorthEastPanning:
return "ne-panning";
case Cursor::kNorthWestPanning:
return "nw-panning";
case Cursor::kSouthPanning:
return "s-panning";
case Cursor::kSouthEastPanning:
return "se-panning";
case Cursor::kSouthWestPanning:
return "sw-panning";
case Cursor::kWestPanning:
return "w-panning";
case Cursor::kMove:
return "move";
case Cursor::kVerticalText:
return "vertical-text";
case Cursor::kCell:
return "cell";
case Cursor::kContextMenu:
return "context-menu";
case Cursor::kAlias:
return "alias";
case Cursor::kProgress:
return "progress";
case Cursor::kNoDrop:
return "nodrop";
case Cursor::kCopy:
return "copy";
case Cursor::kNone:
return "none";
case Cursor::kNotAllowed:
return "not-allowed";
case Cursor::kZoomIn:
return "zoom-in";
case Cursor::kZoomOut:
return "zoom-out";
case Cursor::kGrab:
return "grab";
case Cursor::kGrabbing:
return "grabbing";
case Cursor::kCustom:
return "custom";
default:
return "default";
}
}
} // namespace electron