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

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

Issue 8574033: Beginnings of Window Modality support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_SHELL_TRANSIENT_CONTAINER_LAYOUT_MANAGER_H_
6 #define UI_AURA_SHELL_TRANSIENT_CONTAINER_LAYOUT_MANAGER_H_
7 #pragma once
8
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "ui/aura/layout_manager.h"
15 #include "ui/aura/window_observer.h"
16 #include "ui/aura_shell/aura_shell_export.h"
17 #include "ui/aura_shell/modality_event_filter.h"
18 #include "ui/gfx/compositor/layer_animation_observer.h"
19
20 namespace aura {
21 class Window;
22 class EventFilter;
23 }
24 namespace gfx {
25 class Rect;
26 }
27 namespace views {
28 class Widget;
29 }
30
31 namespace aura_shell {
32 namespace internal {
33
34 // LayoutManager for the transient window container.
35 class AURA_SHELL_EXPORT TransientContainerLayoutManager
36 : public aura::LayoutManager,
37 public aura::WindowObserver,
38 public ui::LayerAnimationObserver,
39 public ModalityEventFilter::Delegate {
40 public:
41 explicit TransientContainerLayoutManager(aura::Window* container);
42 virtual ~TransientContainerLayoutManager();
43
44 // Overridden from aura::LayoutManager:
45 virtual void OnWindowResized() OVERRIDE;
46 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE;
47 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE;
48 virtual void OnChildWindowVisibilityChanged(aura::Window* child,
49 bool visibile) OVERRIDE;
50 virtual void SetChildBounds(aura::Window* child,
51 const gfx::Rect& requested_bounds) OVERRIDE;
52
53 // Overridden from aura::WindowObserver:
54 virtual void OnPropertyChanged(aura::Window* window,
55 const char* key,
56 void* old) OVERRIDE;
57
58 // Overridden from ui::LayerAnimationObserver:
59 virtual void OnLayerAnimationEnded(
60 const ui::LayerAnimationSequence* sequence) OVERRIDE;
61 virtual void OnLayerAnimationAborted(
62 const ui::LayerAnimationSequence* sequence) OVERRIDE;
63 virtual void OnLayerAnimationScheduled(
64 const ui::LayerAnimationSequence* sequence) OVERRIDE;
65
66 // Overridden from ModalityEventFilter::Delegate:
67 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
68
69 private:
70 void AddModalWindow(aura::Window* window);
71 void RemoveModalWindow(aura::Window* window);
72
73 void CreateModalScreen();
74 void DestroyModalScreen();
75 void HideModalScreen();
76
77 aura::Window* modal_window() {
78 return !modal_windows_.empty() ? modal_windows_.back() : NULL;
79 }
80
81 aura::Window* container_;
82 views::Widget* modal_screen_;
sky 2011/11/16 17:13:06 Add a description for these. At least modal_screen
83 std::vector<aura::Window*> modal_windows_;
84 scoped_ptr<aura::EventFilter> modality_filter_;
85
86 DISALLOW_COPY_AND_ASSIGN(TransientContainerLayoutManager);
87 };
88
89 } // namespace internal
90 } // namespace aura_shell
91
92 #endif // UI_AURA_SHELL_TRANSIENT_CONTAINER_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698