Commit 72c25e73 authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

Convert enum to enum class for Widget::MoveLoopEscapeBehavior

Use enum class instead of enum for Widget::MoveLoopEscapeBehavior.
enum class is more type safety.

Bug: 940736
Change-Id: I93a798be271d83179a86cb778a772b2ed70a4872
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547229
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829239}
parent 58aed580
...@@ -1415,8 +1415,8 @@ void TabDragController::RunMoveLoop(const gfx::Vector2d& drag_offset) { ...@@ -1415,8 +1415,8 @@ void TabDragController::RunMoveLoop(const gfx::Vector2d& drag_offset) {
: views::Widget::MoveLoopSource::kTouch; : views::Widget::MoveLoopSource::kTouch;
const views::Widget::MoveLoopEscapeBehavior escape_behavior = const views::Widget::MoveLoopEscapeBehavior escape_behavior =
is_dragging_new_browser_ is_dragging_new_browser_
? views::Widget::MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE ? views::Widget::MoveLoopEscapeBehavior::kHide
: views::Widget::MOVE_LOOP_ESCAPE_BEHAVIOR_DONT_HIDE; : views::Widget::MoveLoopEscapeBehavior::kDontHide;
views::Widget::MoveLoopResult result = move_loop_widget_->RunMoveLoop( views::Widget::MoveLoopResult result = move_loop_widget_->RunMoveLoop(
drag_offset, move_loop_source, escape_behavior); drag_offset, move_loop_source, escape_behavior);
content::NotificationService::current()->Notify( content::NotificationService::current()->Notify(
......
...@@ -421,7 +421,7 @@ Widget::MoveLoopResult DesktopWindowTreeHostWin::RunMoveLoop( ...@@ -421,7 +421,7 @@ Widget::MoveLoopResult DesktopWindowTreeHostWin::RunMoveLoop(
Widget::MoveLoopSource source, Widget::MoveLoopSource source,
Widget::MoveLoopEscapeBehavior escape_behavior) { Widget::MoveLoopEscapeBehavior escape_behavior) {
const bool hide_on_escape = const bool hide_on_escape =
escape_behavior == Widget::MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE; escape_behavior == Widget::MoveLoopEscapeBehavior::kHide;
return message_handler_->RunMoveLoop(drag_offset, hide_on_escape) return message_handler_->RunMoveLoop(drag_offset, hide_on_escape)
? Widget::MOVE_LOOP_SUCCESSFUL ? Widget::MOVE_LOOP_SUCCESSFUL
: Widget::MOVE_LOOP_CANCELED; : Widget::MOVE_LOOP_CANCELED;
......
...@@ -24,7 +24,7 @@ wm::WindowMoveResult WindowMoveClientPlatform::RunMoveLoop( ...@@ -24,7 +24,7 @@ wm::WindowMoveResult WindowMoveClientPlatform::RunMoveLoop(
move_source == wm::WindowMoveSource::WINDOW_MOVE_SOURCE_MOUSE move_source == wm::WindowMoveSource::WINDOW_MOVE_SOURCE_MOUSE
? Widget::MoveLoopSource::kMouse ? Widget::MoveLoopSource::kMouse
: Widget::MoveLoopSource::kTouch, : Widget::MoveLoopSource::kTouch,
Widget::MoveLoopEscapeBehavior::MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE); Widget::MoveLoopEscapeBehavior::kHide);
return move_loop_result == Widget::MOVE_LOOP_SUCCESSFUL ? wm::MOVE_SUCCESSFUL return move_loop_result == Widget::MOVE_LOOP_SUCCESSFUL ? wm::MOVE_SUCCESSFUL
: wm::MOVE_CANCELED; : wm::MOVE_CANCELED;
......
...@@ -122,12 +122,12 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, ...@@ -122,12 +122,12 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
}; };
// Behavior when escape is pressed during a move loop. // Behavior when escape is pressed during a move loop.
enum MoveLoopEscapeBehavior { enum class MoveLoopEscapeBehavior {
// Indicates the window should be hidden. // Indicates the window should be hidden.
MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE, kHide,
// Indicates the window should not be hidden. // Indicates the window should not be hidden.
MOVE_LOOP_ESCAPE_BEHAVIOR_DONT_HIDE, kDontHide,
}; };
// Type of visibility change transition that should animate. // Type of visibility change transition that should animate.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment