Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: components/exo/shell_surface.cc

Issue 2976653002: [M60] exo: Drop window on touch release (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 case ui::ET_MOUSE_EXITED: 1100 case ui::ET_MOUSE_EXITED:
1101 case ui::ET_MOUSEWHEEL: 1101 case ui::ET_MOUSEWHEEL:
1102 case ui::ET_MOUSE_CAPTURE_CHANGED: 1102 case ui::ET_MOUSE_CAPTURE_CHANGED:
1103 break; 1103 break;
1104 default: 1104 default:
1105 NOTREACHED(); 1105 NOTREACHED();
1106 break; 1106 break;
1107 } 1107 }
1108 } 1108 }
1109 1109
1110 void ShellSurface::OnGestureEvent(ui::GestureEvent* event) {
1111 if (!resizer_) {
1112 views::View::OnGestureEvent(event);
1113 return;
1114 }
1115
1116 if (event->handled())
1117 return;
1118
1119 // TODO(domlaskowski): Handle touch dragging/resizing for BoundsMode::SHELL.
1120 // See crbug.com/738606.
1121 switch (event->type()) {
1122 case ui::ET_GESTURE_END: {
1123 ScopedConfigure scoped_configure(this, false);
1124 EndDrag(false /* revert */);
1125 break;
1126 }
1127 case ui::ET_GESTURE_SCROLL_BEGIN:
1128 case ui::ET_GESTURE_SCROLL_END:
1129 case ui::ET_GESTURE_SCROLL_UPDATE:
1130 case ui::ET_GESTURE_TAP:
1131 case ui::ET_GESTURE_TAP_DOWN:
1132 case ui::ET_GESTURE_TAP_CANCEL:
1133 case ui::ET_GESTURE_TAP_UNCONFIRMED:
1134 case ui::ET_GESTURE_DOUBLE_TAP:
1135 case ui::ET_GESTURE_BEGIN:
1136 case ui::ET_GESTURE_TWO_FINGER_TAP:
1137 case ui::ET_GESTURE_PINCH_BEGIN:
1138 case ui::ET_GESTURE_PINCH_END:
1139 case ui::ET_GESTURE_PINCH_UPDATE:
1140 case ui::ET_GESTURE_LONG_PRESS:
1141 case ui::ET_GESTURE_LONG_TAP:
1142 case ui::ET_GESTURE_SWIPE:
1143 case ui::ET_GESTURE_SHOW_PRESS:
1144 case ui::ET_SCROLL:
1145 case ui::ET_SCROLL_FLING_START:
1146 case ui::ET_SCROLL_FLING_CANCEL:
1147 break;
1148 default:
1149 NOTREACHED();
1150 break;
1151 }
1152 }
1153
1110 //////////////////////////////////////////////////////////////////////////////// 1154 ////////////////////////////////////////////////////////////////////////////////
1111 // ui::AcceleratorTarget overrides: 1155 // ui::AcceleratorTarget overrides:
1112 1156
1113 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) { 1157 bool ShellSurface::AcceleratorPressed(const ui::Accelerator& accelerator) {
1114 for (const auto& entry : kCloseWindowAccelerators) { 1158 for (const auto& entry : kCloseWindowAccelerators) {
1115 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) { 1159 if (ui::Accelerator(entry.keycode, entry.modifiers) == accelerator) {
1116 if (!close_callback_.is_null()) 1160 if (!close_callback_.is_null())
1117 close_callback_.Run(); 1161 close_callback_.Run();
1118 return true; 1162 return true;
1119 } 1163 }
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 gfx::Point ShellSurface::GetMouseLocation() const { 1714 gfx::Point ShellSurface::GetMouseLocation() const {
1671 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1715 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1672 gfx::Point location = 1716 gfx::Point location =
1673 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1717 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1674 aura::Window::ConvertPointToTarget( 1718 aura::Window::ConvertPointToTarget(
1675 root_window, widget_->GetNativeWindow()->parent(), &location); 1719 root_window, widget_->GetNativeWindow()->parent(), &location);
1676 return location; 1720 return location;
1677 } 1721 }
1678 1722
1679 } // namespace exo 1723 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698