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