OLD | NEW |
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_APP_LIST_APP_LIST_H_ | 5 #ifndef ASH_APP_LIST_APP_LIST_H_ |
6 #define ASH_APP_LIST_APP_LIST_H_ | 6 #define ASH_APP_LIST_APP_LIST_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/event_filter.h" | 11 #include "ui/aura/event_filter.h" |
| 12 #include "ui/aura/root_window_observer.h" |
12 #include "ui/gfx/compositor/layer_animation_observer.h" | 13 #include "ui/gfx/compositor/layer_animation_observer.h" |
13 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
14 | 15 |
15 namespace ash { | 16 namespace ash { |
16 namespace internal { | 17 namespace internal { |
17 | 18 |
18 // AppList is a controller that manages app list UI for shell. To show the UI, | 19 // AppList is a controller that manages app list UI for shell. To show the UI, |
19 // it requests app list widget from ShellDelegate and shows it when ready. | 20 // it requests app list widget from ShellDelegate and shows it when ready. |
20 // While the UI is visible, it monitors things such as app list widget's | 21 // While the UI is visible, it monitors things such as app list widget's |
21 // activation state and desktop mouse click to auto dismiss the UI. | 22 // activation state and desktop mouse click to auto dismiss the UI. |
22 class AppList : public aura::EventFilter, | 23 class AppList : public aura::EventFilter, |
| 24 public aura::RootWindowObserver, |
23 public ui::ImplicitAnimationObserver, | 25 public ui::ImplicitAnimationObserver, |
24 public views::Widget::Observer { | 26 public views::Widget::Observer { |
25 public: | 27 public: |
26 AppList(); | 28 AppList(); |
27 virtual ~AppList(); | 29 virtual ~AppList(); |
28 | 30 |
29 // Show/hide app list window. | 31 // Show/hide app list window. |
30 void SetVisible(bool visible); | 32 void SetVisible(bool visible); |
31 | 33 |
32 // Whether app list window is visible (shown or being shown). | 34 // Whether app list window is visible (shown or being shown). |
(...skipping 14 matching lines...) Expand all Loading... |
47 virtual bool PreHandleKeyEvent(aura::Window* target, | 49 virtual bool PreHandleKeyEvent(aura::Window* target, |
48 aura::KeyEvent* event) OVERRIDE; | 50 aura::KeyEvent* event) OVERRIDE; |
49 virtual bool PreHandleMouseEvent(aura::Window* target, | 51 virtual bool PreHandleMouseEvent(aura::Window* target, |
50 aura::MouseEvent* event) OVERRIDE; | 52 aura::MouseEvent* event) OVERRIDE; |
51 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, | 53 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, |
52 aura::TouchEvent* event) OVERRIDE; | 54 aura::TouchEvent* event) OVERRIDE; |
53 virtual ui::GestureStatus PreHandleGestureEvent( | 55 virtual ui::GestureStatus PreHandleGestureEvent( |
54 aura::Window* target, | 56 aura::Window* target, |
55 aura::GestureEvent* event) OVERRIDE; | 57 aura::GestureEvent* event) OVERRIDE; |
56 | 58 |
| 59 // aura::RootWindowObserver overrides: |
| 60 virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE; |
| 61 |
57 // ui::ImplicitAnimationObserver overrides: | 62 // ui::ImplicitAnimationObserver overrides: |
58 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 63 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
59 | 64 |
60 // views::Widget::Observer overrides: | 65 // views::Widget::Observer overrides: |
61 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 66 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
62 virtual void OnWidgetActivationChanged(views::Widget* widget, | 67 virtual void OnWidgetActivationChanged(views::Widget* widget, |
63 bool active) OVERRIDE; | 68 bool active) OVERRIDE; |
64 | 69 |
65 // Whether we should show or hide app list widget. | 70 // Whether we should show or hide app list widget. |
66 bool is_visible_; | 71 bool is_visible_; |
67 | 72 |
68 // App list widget we get from ShellDelegate. | 73 // App list widget we get from ShellDelegate. |
69 views::Widget* widget_; | 74 views::Widget* widget_; |
70 | 75 |
71 DISALLOW_COPY_AND_ASSIGN(AppList); | 76 DISALLOW_COPY_AND_ASSIGN(AppList); |
72 }; | 77 }; |
73 | 78 |
74 } // namespace internal | 79 } // namespace internal |
75 } // namespace ash | 80 } // namespace ash |
76 | 81 |
77 #endif // ASH_APP_LIST_APP_LIST_H_ | 82 #endif // ASH_APP_LIST_APP_LIST_H_ |
OLD | NEW |