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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 case ui::ET_MOUSE_EXITED: | 1118 case ui::ET_MOUSE_EXITED: |
| 1119 case ui::ET_MOUSEWHEEL: | 1119 case ui::ET_MOUSEWHEEL: |
| 1120 case ui::ET_MOUSE_CAPTURE_CHANGED: | 1120 case ui::ET_MOUSE_CAPTURE_CHANGED: |
| 1121 break; | 1121 break; |
| 1122 default: | 1122 default: |
| 1123 NOTREACHED(); | 1123 NOTREACHED(); |
| 1124 break; | 1124 break; |
| 1125 } | 1125 } |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 void ShellSurface::OnGestureEvent(ui::GestureEvent* event) { | |
| 1129 if (!resizer_) { | |
| 1130 views::View::OnGestureEvent(event); | |
| 1131 return; | |
| 1132 } | |
| 1133 | |
| 1134 if (event->handled()) | |
| 1135 return; | |
| 1136 | |
| 1137 switch (event->type()) { | |
| 1138 case ui::ET_GESTURE_END: { | |
|
oshima
2017/06/29 22:52:34
if (type == ET_GESTURE_END) { ?
Dominik Laskowski
2017/06/30 17:45:44
XDG clients can't be dragged/resized using touch,
| |
| 1139 ScopedConfigure scoped_configure(this, false); | |
| 1140 EndDrag(false /* revert */); | |
| 1141 break; | |
| 1142 } | |
| 1143 | |
| 1144 default: break; | |
|
reveman
2017/06/30 19:50:15
nit: NOTREACHED() here and add other GESTURE event
Dominik Laskowski
2017/06/30 20:50:06
Checked the range instead to avoid 20+ cases.
| |
| 1145 } | |
| 1146 } | |
| 1147 | |
| 1128 //////////////////////////////////////////////////////////////////////////////// | 1148 //////////////////////////////////////////////////////////////////////////////// |
| 1129 // ui::AcceleratorTarget overrides: | 1149 // ui::AcceleratorTarget overrides: |
| 1130 | 1150 |
| 1131 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { | 1151 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 1132 for (const auto& entry : kCloseWindowAccelerators) { | 1152 for (const auto& entry : kCloseWindowAccelerators) { |
| 1133 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { | 1153 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { |
| 1134 if (!close_callback_.is_null()) | 1154 if (!close_callback_.is_null()) |
| 1135 close_callback_.Run(); | 1155 close_callback_.Run(); |
| 1136 return true; | 1156 return true; |
| 1137 } | 1157 } |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1687 gfx::Point ShellSurface::GetMouseLocation() const { | 1707 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1688 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1708 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1689 gfx::Point location = | 1709 gfx::Point location = |
| 1690 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1710 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1691 aura::Window::ConvertPointToTarget( | 1711 aura::Window::ConvertPointToTarget( |
| 1692 root_window, widget_->GetNativeWindow()->parent(), &location); | 1712 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1693 return location; | 1713 return location; |
| 1694 } | 1714 } |
| 1695 | 1715 |
| 1696 } // namespace exo | 1716 } // namespace exo |
| OLD | NEW |