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 switch (event->type()) { | |
| 1131 case ui::ET_GESTURE_END: { | |
| 1132 ScopedConfigure scoped_configure(this, false); | |
| 1133 EndDrag(false /* revert */); | |
| 1134 break; | |
| 1135 } | |
| 1136 | |
|
reveman
2017/06/30 21:48:16
nit: remove this blank line
Dominik Laskowski
2017/06/30 22:27:57
Done.
| |
| 1137 default: | |
| 1138 DCHECK_GE(event->type(), ui::ET_GESTURE_TYPE_START); | |
|
reveman
2017/06/30 21:48:16
either add all enum values above even if there's a
Dominik Laskowski
2017/06/30 22:27:57
Done.
| |
| 1139 DCHECK_LE(event->type(), ui::ET_GESTURE_TYPE_END); | |
| 1140 break; | |
| 1141 } | |
| 1142 } | |
| 1143 | |
| 1121 //////////////////////////////////////////////////////////////////////////////// | 1144 //////////////////////////////////////////////////////////////////////////////// |
| 1122 // ui::AcceleratorTarget overrides: | 1145 // ui::AcceleratorTarget overrides: |
| 1123 | 1146 |
| 1124 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { | 1147 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 1125 for (const auto& entry : kCloseWindowAccelerators) { | 1148 for (const auto& entry : kCloseWindowAccelerators) { |
| 1126 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { | 1149 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { |
| 1127 if (!close_callback_.is_null()) | 1150 if (!close_callback_.is_null()) |
| 1128 close_callback_.Run(); | 1151 close_callback_.Run(); |
| 1129 return true; | 1152 return true; |
| 1130 } | 1153 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1681 gfx::Point ShellSurface::GetMouseLocation() const { | 1704 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1682 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1705 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1683 gfx::Point location = | 1706 gfx::Point location = |
| 1684 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1707 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1685 aura::Window::ConvertPointToTarget( | 1708 aura::Window::ConvertPointToTarget( |
| 1686 root_window, widget_->GetNativeWindow()->parent(), &location); | 1709 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1687 return location; | 1710 return location; |
| 1688 } | 1711 } |
| 1689 | 1712 |
| 1690 } // namespace exo | 1713 } // namespace exo |
| OLD | NEW |