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

Side by Side Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 12441010: Attach panel while dragging to bring it in front of other panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments, etc. Created 7 years, 9 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 | Annotate | Revision Log
« ash/wm/window_resizer_owner.h ('K') | « ash/wm/window_resizer_owner.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 (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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 #include "ui/aura/root_window.h" 26 #include "ui/aura/root_window.h"
27 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
28 #include "ui/aura/window_delegate.h" 28 #include "ui/aura/window_delegate.h"
29 #include "ui/base/hit_test.h" 29 #include "ui/base/hit_test.h"
30 #include "ui/compositor/layer.h" 30 #include "ui/compositor/layer.h"
31 #include "ui/gfx/screen.h" 31 #include "ui/gfx/screen.h"
32 #include "ui/gfx/transform.h" 32 #include "ui/gfx/transform.h"
33 33
34 namespace ash { 34 namespace ash {
35 35
36 scoped_ptr<WindowResizer> CreateWindowResizer(aura::Window* window, 36 scoped_ptr<WindowResizer> CreateWindowResizer(WindowResizerOwner* owner,
37 aura::Window* window,
37 const gfx::Point& point_in_parent, 38 const gfx::Point& point_in_parent,
38 int window_component) { 39 int window_component) {
39 DCHECK(window); 40 DCHECK(window);
40 // No need to return a resizer when the window cannot get resized. 41 // No need to return a resizer when the window cannot get resized.
41 if (!wm::CanResizeWindow(window) && window_component != HTCAPTION) 42 if (!wm::CanResizeWindow(window) && window_component != HTCAPTION)
42 return scoped_ptr<WindowResizer>(); 43 return scoped_ptr<WindowResizer>();
43 44
44 WindowResizer* window_resizer = NULL; 45 WindowResizer* window_resizer = NULL;
45 if (window->type() == aura::client::WINDOW_TYPE_PANEL) { 46 if (window->type() == aura::client::WINDOW_TYPE_PANEL) {
46 window_resizer = PanelWindowResizer::Create( 47 window_resizer = PanelWindowResizer::Create(
47 window, point_in_parent, window_component); 48 owner, window, point_in_parent, window_component);
48 } else if (window->parent() && 49 } else if (window->parent() &&
49 window->parent()->id() == internal::kShellWindowId_WorkspaceContainer) { 50 window->parent()->id() == internal::kShellWindowId_WorkspaceContainer) {
50 // Allow dragging maximized windows if it's not tracked by workspace. This 51 // Allow dragging maximized windows if it's not tracked by workspace. This
51 // is set by tab dragging code. 52 // is set by tab dragging code.
52 if (!wm::IsWindowNormal(window) && 53 if (!wm::IsWindowNormal(window) &&
53 (window_component != HTCAPTION || GetTrackedByWorkspace(window))) 54 (window_component != HTCAPTION || GetTrackedByWorkspace(window)))
54 return scoped_ptr<WindowResizer>(); 55 return scoped_ptr<WindowResizer>();
55 window_resizer = internal::WorkspaceWindowResizer::Create( 56 window_resizer = internal::WorkspaceWindowResizer::Create(
56 window, 57 window,
57 point_in_parent, 58 point_in_parent,
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 gfx::Rect area(ScreenAsh::GetDisplayBoundsInParent(window())); 827 gfx::Rect area(ScreenAsh::GetDisplayBoundsInParent(window()));
827 if (location.x() <= area.x()) 828 if (location.x() <= area.x())
828 return SNAP_LEFT_EDGE; 829 return SNAP_LEFT_EDGE;
829 if (location.x() >= area.right() - 1) 830 if (location.x() >= area.right() - 1)
830 return SNAP_RIGHT_EDGE; 831 return SNAP_RIGHT_EDGE;
831 return SNAP_NONE; 832 return SNAP_NONE;
832 } 833 }
833 834
834 } // namespace internal 835 } // namespace internal
835 } // namespace ash 836 } // namespace ash
OLDNEW
« ash/wm/window_resizer_owner.h ('K') | « ash/wm/window_resizer_owner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698