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

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

Issue 9467021: Attempt 3: Makes managed mode constrain the height of windows so they don't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Da fix Created 8 years, 10 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
6 #define ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
7 #pragma once
8
9 #include "ash/wm/window_resizer.h"
10 #include "base/compiler_specific.h"
11
12 namespace ash {
13 namespace internal {
14
15 // WindowResizer implementation for workspaces. This enforces that windows are
16 // not allowed to vertically move or resize outside of the work area. As windows
17 // are moved outside the work area they are shrunk. We remember the height of
18 // the window before it was moved so that if the window is again moved up we
19 // attempt to restore the old height.
20 class ASH_EXPORT WorkspaceWindowResizer : public WindowResizer {
21 public:
22 WorkspaceWindowResizer(aura::Window* window,
23 const gfx::Point& location,
24 int window_component,
25 int grid_size);
26 virtual ~WorkspaceWindowResizer();
27
28 protected:
29 // WindowResizer overrides:
30 virtual gfx::Rect GetBoundsForDrag(const gfx::Point& location) OVERRIDE;
31 virtual gfx::Rect GetFinalBounds() OVERRIDE;
32
33 private:
34 // Used to maintain the height of the window before we started collapsing it.
35 static void SetHeightBeforeObscured(aura::Window* window, int height);
36 static void ClearHeightBeforeObscured(aura::Window* window);
37 static int GetHeightBeforeObscured(aura::Window* window);
38
39 // Adjusts the bounds to enforce that windows are vertically contained in the
40 // work area.
41 void AdjustBounds(gfx::Rect* bounds) const;
42
43 // Returns true if the window touches the bottom of the work area.
44 bool WindowTouchesBottomOfScreen() const;
45
46 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer);
47 };
48
49 } // namespace internal
50 } // namespace ash
51
52 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.cc ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698