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

Side by Side Diff: ash/wm/panel_layout_manager.h

Issue 10174037: Implement a callout widget for the active panel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add newline Created 8 years, 8 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
« no previous file with comments | « no previous file | ash/wm/panel_layout_manager.cc » ('j') | 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 #ifndef ASH_WM_PANEL_LAYOUT_MANAGER_H_ 5 #ifndef ASH_WM_PANEL_LAYOUT_MANAGER_H_
6 #define ASH_WM_PANEL_LAYOUT_MANAGER_H_ 6 #define ASH_WM_PANEL_LAYOUT_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/launcher/launcher_icon_observer.h" 12 #include "ash/launcher/launcher_icon_observer.h"
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h"
15 #include "ui/aura/layout_manager.h" 17 #include "ui/aura/layout_manager.h"
16 #include "ui/aura/window_observer.h" 18 #include "ui/aura/window_observer.h"
17 19
18 namespace aura { 20 namespace aura {
19 class Window; 21 class Window;
20 } 22 }
21 23
22 namespace gfx { 24 namespace gfx {
23 class Rect; 25 class Rect;
24 } 26 }
25 27
28 namespace views {
29 class Widget;
30 }
31
26 namespace ash { 32 namespace ash {
27 class Launcher; 33 class Launcher;
28 34
29 namespace internal { 35 namespace internal {
30 36
31 // PanelLayoutManager is responsible for organizing panels within the 37 // PanelLayoutManager is responsible for organizing panels within the
32 // workspace. It is associated with a specific container window (i.e. 38 // workspace. It is associated with a specific container window (i.e.
33 // kShellWindowId_PanelContainer) and controls the layout of any windows 39 // kShellWindowId_PanelContainer) and controls the layout of any windows
34 // added to that container. 40 // added to that container.
35 // 41 //
(...skipping 26 matching lines...) Expand all
62 const gfx::Rect& requested_bounds) OVERRIDE; 68 const gfx::Rect& requested_bounds) OVERRIDE;
63 69
64 // Overridden from ash::LauncherIconObserver 70 // Overridden from ash::LauncherIconObserver
65 virtual void OnLauncherIconPositionsChanged() OVERRIDE; 71 virtual void OnLauncherIconPositionsChanged() OVERRIDE;
66 72
67 // Overridden from aura::WindowObserver 73 // Overridden from aura::WindowObserver
68 virtual void OnWindowPropertyChanged( 74 virtual void OnWindowPropertyChanged(
69 aura::Window* window, const void* key, intptr_t old) OVERRIDE; 75 aura::Window* window, const void* key, intptr_t old) OVERRIDE;
70 76
71 private: 77 private:
78 friend class PanelLayoutManagerTest;
79
72 typedef std::list<aura::Window*> PanelList; 80 typedef std::list<aura::Window*> PanelList;
73 81
74 // Called whenever the panel layout might change. 82 // Called whenever the panel layout might change.
75 void Relayout(); 83 void Relayout();
76 84
77 // Called whenever the panel stacking order needs to be updated (e.g. focus 85 // Called whenever the panel stacking order needs to be updated (e.g. focus
78 // changes or a panel is moved). 86 // changes or a panel is moved).
79 void UpdateStacking(aura::Window* active_panel); 87 void UpdateStacking(aura::Window* active_panel);
80 88
89 // Trigger a delayed task to update the callout. We use this because
90 // otherwise, ShadowController::OnWindowPropertyChanged may be invoked after
91 // we've already updated the callout, causing the drop shadow to be stacked on
92 // top of the callout rather than the other way around.
93 // TODO(dcheng): Possibly a bug in the shadow controller. If a window is
sky 2012/04/27 23:02:36 Please file a bug on this.
94 // focused but not stacked at the top, I don't think its shadow should be
95 // drawn on top of "higher" windows.
96 void UpdateCallout(aura::Window* active_window);
97
98 // Don't call this directly. Only UpdateCallout() should call this method.
99 void ShowCalloutHelper(aura::Window* active_panel);
100
101 // For testing.
102 views::Widget* callout_widget() const { return callout_widget_.get(); }
103
81 // Parent window associated with this layout manager. 104 // Parent window associated with this layout manager.
82 aura::Window* panel_container_; 105 aura::Window* panel_container_;
83 // Protect against recursive calls to Relayout(). 106 // Protect against recursive calls to Relayout().
84 bool in_layout_; 107 bool in_layout_;
85 // Ordered list of unowned pointers to panel windows. 108 // Ordered list of unowned pointers to panel windows.
86 PanelList panel_windows_; 109 PanelList panel_windows_;
87 // The panel being dragged. 110 // The panel being dragged.
88 aura::Window* dragged_panel_; 111 aura::Window* dragged_panel_;
89 // The launcher we are observing for launcher icon changes. 112 // The launcher we are observing for launcher icon changes.
90 Launcher* launcher_; 113 Launcher* launcher_;
91 // The last active panel. Used to maintain stacking even if no panels are 114 // The last active panel. Used to maintain stacking even if no panels are
92 // currently focused. 115 // currently focused.
93 aura::Window* last_active_panel_; 116 aura::Window* last_active_panel_;
117 // Manage the callout for the focused panel, if any.
118 scoped_ptr<views::Widget> callout_widget_;
119 base::WeakPtrFactory<PanelLayoutManager> weak_factory_;
94 120
95 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); 121 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager);
96 }; 122 };
97 123
98 } // namespace internal 124 } // namespace internal
99 } // namespace ash 125 } // namespace ash
100 126
101 #endif // ASH_WM_PANEL_LAYOUT_MANAGER_H_ 127 #endif // ASH_WM_PANEL_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/wm/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698