Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
| 10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1111 case ui::ET_MOUSE_EXITED: | 1111 case ui::ET_MOUSE_EXITED: |
| 1112 case ui::ET_MOUSEWHEEL: | 1112 case ui::ET_MOUSEWHEEL: |
| 1113 case ui::ET_MOUSE_CAPTURE_CHANGED: | 1113 case ui::ET_MOUSE_CAPTURE_CHANGED: |
| 1114 break; | 1114 break; |
| 1115 default: | 1115 default: |
| 1116 NOTREACHED(); | 1116 NOTREACHED(); |
| 1117 break; | 1117 break; |
| 1118 } | 1118 } |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 void ShellSurface::OnGestureEvent(ui::GestureEvent* event) { | |
| 1122 if (!resizer_) { | |
| 1123 views::View::OnGestureEvent(event); | |
| 1124 return; | |
| 1125 } | |
| 1126 | |
| 1127 if (event->handled()) | |
| 1128 return; | |
| 1129 | |
| 1130 // TODO(domlaskowski): Handle touch dragging/resizing for BoundsMode::SHELL. | |
|
reveman
2017/06/30 22:30:07
nit: please add bug number
Dominik Laskowski
2017/06/30 22:44:16
Done.
| |
| 1131 switch (event->type()) { | |
| 1132 case ui::ET_GESTURE_END: { | |
| 1133 ScopedConfigure scoped_configure(this, false); | |
| 1134 EndDrag(false /* revert */); | |
| 1135 break; | |
| 1136 } | |
| 1137 case ui::ET_GESTURE_SCROLL_BEGIN: | |
| 1138 case ui::ET_GESTURE_SCROLL_END: | |
| 1139 case ui::ET_GESTURE_SCROLL_UPDATE: | |
| 1140 case ui::ET_GESTURE_TAP: | |
| 1141 case ui::ET_GESTURE_TAP_DOWN: | |
| 1142 case ui::ET_GESTURE_TAP_CANCEL: | |
| 1143 case ui::ET_GESTURE_TAP_UNCONFIRMED: | |
| 1144 case ui::ET_GESTURE_DOUBLE_TAP: | |
| 1145 case ui::ET_GESTURE_BEGIN: | |
| 1146 case ui::ET_GESTURE_TWO_FINGER_TAP: | |
| 1147 case ui::ET_GESTURE_PINCH_BEGIN: | |
| 1148 case ui::ET_GESTURE_PINCH_END: | |
| 1149 case ui::ET_GESTURE_PINCH_UPDATE: | |
| 1150 case ui::ET_GESTURE_LONG_PRESS: | |
| 1151 case ui::ET_GESTURE_LONG_TAP: | |
| 1152 case ui::ET_GESTURE_SWIPE: | |
| 1153 case ui::ET_GESTURE_SHOW_PRESS: | |
| 1154 case ui::ET_SCROLL: | |
| 1155 case ui::ET_SCROLL_FLING_START: | |
| 1156 case ui::ET_SCROLL_FLING_CANCEL: | |
| 1157 break; | |
| 1158 default: | |
| 1159 NOTREACHED(); | |
| 1160 break; | |
| 1161 } | |
| 1162 } | |
| 1163 | |
| 1121 //////////////////////////////////////////////////////////////////////////////// | 1164 //////////////////////////////////////////////////////////////////////////////// |
| 1122 // ui::AcceleratorTarget overrides: | 1165 // ui::AcceleratorTarget overrides: |
| 1123 | 1166 |
| 1124 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { | 1167 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 1125 for (const auto& entry : kCloseWindowAccelerators) { | 1168 for (const auto& entry : kCloseWindowAccelerators) { |
| 1126 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { | 1169 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { |
| 1127 if (!close_callback_.is_null()) | 1170 if (!close_callback_.is_null()) |
| 1128 close_callback_.Run(); | 1171 close_callback_.Run(); |
| 1129 return true; | 1172 return true; |
| 1130 } | 1173 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1681 gfx::Point ShellSurface::GetMouseLocation() const { | 1724 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1682 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1725 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1683 gfx::Point location = | 1726 gfx::Point location = |
| 1684 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1727 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1685 aura::Window::ConvertPointToTarget( | 1728 aura::Window::ConvertPointToTarget( |
| 1686 root_window, widget_->GetNativeWindow()->parent(), &location); | 1729 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1687 return location; | 1730 return location; |
| 1688 } | 1731 } |
| 1689 | 1732 |
| 1690 } // namespace exo | 1733 } // namespace exo |
| OLD | NEW |