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

Side by Side Diff: ui/aura_shell/default_container_layout_manager.h

Issue 8381015: Add workspace to desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 2 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ 5 #ifndef UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_
6 #define UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ 6 #define UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "ui/aura/layout_manager.h" 11 #include "ui/aura/layout_manager.h"
12 #include "ui/aura_shell/aura_shell_export.h" 12 #include "ui/aura_shell/aura_shell_export.h"
13 13
14 namespace aura { 14 namespace aura {
15 class MouseEvent;
15 class Window; 16 class Window;
16 } 17 }
17 18
18 namespace gfx { 19 namespace gfx {
19 class Rect; 20 class Rect;
20 } 21 }
21 22
22 namespace aura_shell { 23 namespace aura_shell {
24 class WorkspaceManager;
25
23 namespace internal { 26 namespace internal {
24 27
25 // LayoutManager for the default window container. 28 // LayoutManager for the default window container.
26 class AURA_SHELL_EXPORT DefaultContainerLayoutManager 29 class AURA_SHELL_EXPORT DefaultContainerLayoutManager
27 : public aura::LayoutManager { 30 : public aura::LayoutManager {
28 public: 31 public:
29 explicit DefaultContainerLayoutManager(aura::Window* owner); 32 DefaultContainerLayoutManager(
33 aura::Window* owner, WorkspaceManager* workspace_manager);
sky 2011/10/25 20:58:05 each param on its own line.
oshima 2011/10/25 23:37:23 Done.
30 virtual ~DefaultContainerLayoutManager(); 34 virtual ~DefaultContainerLayoutManager();
31 35
32 // Overridden from aura::LayoutManager: 36 // Overridden from aura::LayoutManager:
33 virtual void OnWindowResized() OVERRIDE; 37 virtual void OnWindowResized() OVERRIDE;
34 virtual void OnWindowAdded(aura::Window* child) OVERRIDE; 38 virtual void OnWindowAdded(aura::Window* child) OVERRIDE;
35 virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE; 39 virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE;
36 virtual void OnChildWindowVisibilityChanged(aura::Window* child, 40 virtual void OnChildWindowVisibilityChanged(aura::Window* child,
37 bool visibile) OVERRIDE; 41 bool visibile) OVERRIDE;
38 virtual void CalculateBoundsForChild(aura::Window* child, 42 virtual void CalculateBoundsForChild(aura::Window* child,
39 gfx::Rect* requested_bounds) OVERRIDE; 43 gfx::Rect* requested_bounds) OVERRIDE;
40 44
45 // Invoked when a window receives drag event.
sky 2011/10/25 20:58:05 nit: keep non-virtual methods before virtual metho
oshima 2011/10/25 23:37:23 Done.
46 void PrepareForMoveOrResize(aura::Window* drag, aura::MouseEvent* event);
47
48 // Invoked when a drag event didn't start any drag operation.
49 void CancelMoveOrResize(aura::Window* drag, aura::MouseEvent* event);
50
51 // Invoked when a user finished moving window.
52 void EndMove(aura::Window* drag, aura::MouseEvent* evnet);
53
54 // Invoked when a user finished resizing window.
55 void EndResize(aura::Window* drag, aura::MouseEvent* evnet);
56
41 private: 57 private:
42 aura::Window* owner_; 58 aura::Window* owner_;
43 59
60 WorkspaceManager* workspace_manager_;
61
62 // A window that are currently moved or resized. Used to put
63 // different constraints on drag window.
64 aura::Window* drag_window_;
65
66 // A flag to control layout behavior. This is set to true while
67 // workspace manager is laying out children and LayoutManager
68 // skips bounds check.
69 bool layout_manager_has_control_;
sky 2011/10/25 20:58:05 How about naming this ignore_calculate_bounds_?
oshima 2011/10/25 23:37:23 Done.
70
44 DISALLOW_COPY_AND_ASSIGN(DefaultContainerLayoutManager); 71 DISALLOW_COPY_AND_ASSIGN(DefaultContainerLayoutManager);
45 }; 72 };
46 73
47 } // namespace internal 74 } // namespace internal
48 } // namespace aura_shell 75 } // namespace aura_shell
49 76
50 #endif // UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ 77 #endif // UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698