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/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 Details details(window, location_in_parent, window_component); | 81 Details details(window, location_in_parent, window_component); |
82 return details.is_resizable ? | 82 return details.is_resizable ? |
83 new WorkspaceWindowResizer(details, attached_windows) : NULL; | 83 new WorkspaceWindowResizer(details, attached_windows) : NULL; |
84 } | 84 } |
85 | 85 |
86 void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) { | 86 void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
87 std::pair<aura::RootWindow*, gfx::Point> actual_location = | 87 std::pair<aura::RootWindow*, gfx::Point> actual_location = |
88 wm::GetRootWindowRelativeToWindow(window()->parent(), location); | 88 wm::GetRootWindowRelativeToWindow(window()->parent(), location); |
89 aura::RootWindow* current_root = actual_location.first; | 89 aura::RootWindow* current_root = actual_location.first; |
90 gfx::Point location_in_parent = actual_location.second; | 90 gfx::Point location_in_parent = actual_location.second; |
91 aura::Window::ConvertPointToWindow(current_root, | 91 aura::Window::ConvertPointToTarget(current_root, |
92 window()->parent(), | 92 window()->parent(), |
93 &location_in_parent); | 93 &location_in_parent); |
94 | 94 |
95 // Do not use |location| below this point, use |location_in_parent| instead. | 95 // Do not use |location| below this point, use |location_in_parent| instead. |
96 // When the pointer is on |window()->GetRootWindow()|, |location| and | 96 // When the pointer is on |window()->GetRootWindow()|, |location| and |
97 // |location_in_parent| have the same value and both of them are in | 97 // |location_in_parent| have the same value and both of them are in |
98 // |window()->parent()|'s coordinates, but once the pointer enters the | 98 // |window()->parent()|'s coordinates, but once the pointer enters the |
99 // other root window, you will see an unexpected value on the former. See | 99 // other root window, you will see an unexpected value on the former. See |
100 // comments in wm::GetRootWindowRelativeToWindow() for details. | 100 // comments in wm::GetRootWindowRelativeToWindow() for details. |
101 | 101 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 | 539 |
540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { | 540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { |
541 return (details_.window_component == HTCAPTION) && | 541 return (details_.window_component == HTCAPTION) && |
542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && | 542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && |
543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); | 543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); |
544 } | 544 } |
545 | 545 |
546 } // namespace internal | 546 } // namespace internal |
547 } // namespace ash | 547 } // namespace ash |
OLD | NEW |