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

Unified Diff: ash/wm/toplevel_window_event_filter.cc

Issue 10008084: Add ctrl+drag feature for allowing resizing window with exact positioning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/toplevel_window_event_filter.h ('k') | ash/wm/toplevel_window_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_filter.cc
diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc
index 53e388fb89e1920c6edfd71eaa6230d048230637..e6b9dc070e9a8fc2bdfb83c55a837ad6e08be4cf 100644
--- a/ash/wm/toplevel_window_event_filter.cc
+++ b/ash/wm/toplevel_window_event_filter.cc
@@ -57,7 +57,7 @@ bool ToplevelWindowEventFilter::PreHandleKeyEvent(aura::Window* target,
aura::KeyEvent* event) {
if (window_resizer_.get() && event->type() == ui::ET_KEY_PRESSED &&
event->key_code() == ui::VKEY_ESCAPE) {
- CompleteDrag(DRAG_REVERT);
+ CompleteDrag(DRAG_REVERT, event->flags());
}
return false;
}
@@ -94,7 +94,8 @@ bool ToplevelWindowEventFilter::PreHandleMouseEvent(aura::Window* target,
case ui::ET_MOUSE_CAPTURE_CHANGED:
case ui::ET_MOUSE_RELEASED:
CompleteDrag(event->type() == ui::ET_MOUSE_RELEASED ?
- DRAG_COMPLETE : DRAG_REVERT);
+ DRAG_COMPLETE : DRAG_REVERT,
+ event->flags());
if (in_move_loop_) {
MessageLoop::current()->Quit();
in_move_loop_ = false;
@@ -183,7 +184,7 @@ ui::GestureStatus ToplevelWindowEventFilter::PreHandleGestureEvent(
}
if (!drag_done)
- CompleteDrag(DRAG_COMPLETE);
+ CompleteDrag(DRAG_COMPLETE, event->flags());
in_gesture_resize_ = false;
break;
}
@@ -232,15 +233,15 @@ WindowResizer* ToplevelWindowEventFilter::CreateWindowResizer(
int window_component) {
if (!wm::IsWindowNormal(window))
return NULL; // Don't allow resizing/dragging maximized/fullscreen windows.
- return DefaultWindowResizer::Create(
- window, point, window_component, grid_size_);
+ return DefaultWindowResizer::Create(window, point, window_component);
}
-void ToplevelWindowEventFilter::CompleteDrag(DragCompletionStatus status) {
+void ToplevelWindowEventFilter::CompleteDrag(DragCompletionStatus status,
+ int event_flags) {
scoped_ptr<WindowResizer> resizer(window_resizer_.release());
if (resizer.get()) {
if (status == DRAG_COMPLETE)
- resizer->CompleteDrag();
+ resizer->CompleteDrag(event_flags);
else
resizer->RevertDrag();
}
@@ -256,7 +257,8 @@ bool ToplevelWindowEventFilter::HandleDrag(aura::Window* target,
if (!window_resizer_.get())
return false;
- window_resizer_->Drag(ConvertPointToParent(target, event->location()));
+ window_resizer_->Drag(ConvertPointToParent(target, event->location()),
+ event->flags());
return true;
}
« no previous file with comments | « ash/wm/toplevel_window_event_filter.h ('k') | ash/wm/toplevel_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698