| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 Shell* shell = Shell::GetInstance(); | 50 Shell* shell = Shell::GetInstance(); |
| 51 shell->mouse_cursor_filter()->set_mouse_warp_mode( | 51 shell->mouse_cursor_filter()->set_mouse_warp_mode( |
| 52 MouseCursorEventFilter::WARP_ALWAYS); | 52 MouseCursorEventFilter::WARP_ALWAYS); |
| 53 shell->mouse_cursor_filter()->HideSharedEdgeIndicator(); | 53 shell->mouse_cursor_filter()->HideSharedEdgeIndicator(); |
| 54 | 54 |
| 55 if (destroyed_) | 55 if (destroyed_) |
| 56 *destroyed_ = true; | 56 *destroyed_ = true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 DragWindowResizer* DragWindowResizer::Create(WindowResizer* next_window_resizer, | 60 DragWindowResizer* DragWindowResizer::Create( |
| 61 aura::Window* window, | 61 WindowResizer* next_window_resizer, |
| 62 const gfx::Point& location, | 62 aura::Window* window, |
| 63 int window_component) { | 63 const gfx::Point& location, |
| 64 Details details(window, location, window_component); | 64 int window_component, |
| 65 aura::client::WindowMoveSource source) { |
| 66 Details details(window, location, window_component, source); |
| 65 return details.is_resizable ? | 67 return details.is_resizable ? |
| 66 new DragWindowResizer(next_window_resizer, details) : NULL; | 68 new DragWindowResizer(next_window_resizer, details) : NULL; |
| 67 } | 69 } |
| 68 | 70 |
| 69 void DragWindowResizer::Drag(const gfx::Point& location, int event_flags) { | 71 void DragWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
| 70 bool destroyed = false; | 72 bool destroyed = false; |
| 71 destroyed_ = &destroyed; | 73 destroyed_ = &destroyed; |
| 72 next_window_resizer_->Drag(location, event_flags); | 74 next_window_resizer_->Drag(location, event_flags); |
| 73 | 75 |
| 74 // TODO(flackr): Refactor the way WindowResizer calls into other window | 76 // TODO(flackr): Refactor the way WindowResizer calls into other window |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 192 |
| 191 bool DragWindowResizer::ShouldAllowMouseWarp() { | 193 bool DragWindowResizer::ShouldAllowMouseWarp() { |
| 192 return (details_.window_component == HTCAPTION) && | 194 return (details_.window_component == HTCAPTION) && |
| 193 !GetTarget()->transient_parent() && | 195 !GetTarget()->transient_parent() && |
| 194 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || | 196 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || |
| 195 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); | 197 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); |
| 196 } | 198 } |
| 197 | 199 |
| 198 } // namespace internal | 200 } // namespace internal |
| 199 } // namespace ash | 201 } // namespace ash |
| OLD | NEW |