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

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

Issue 8890049: [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 8 years, 12 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 | « chrome/test/data/extensions/app_list/Preferences ('k') | ui/aura_shell/app_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_APP_LIST_H_
6 #define UI_AURA_SHELL_APP_LIST_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ui/aura/event_filter.h"
13 #include "ui/gfx/compositor/layer_animation_observer.h"
14 #include "ui/views/widget/widget.h"
15
16 namespace aura_shell {
17 namespace internal {
18
19 // AppList is a controller that manages app list UI for shell. To show the UI,
20 // it requests app list widget from ShellDelegate and shows it when ready.
21 // While the UI is visible, it monitors things such as app list widget's
22 // activation state and desktop mouse click to auto dismiss the UI.
23 class AppList : public aura::EventFilter,
24 public ui::LayerAnimationObserver,
25 public views::Widget::Observer {
26 public:
27 AppList();
28 virtual ~AppList();
29
30 // Show/hide app list window.
31 void SetVisible(bool visible);
32
33 // Whether app list window is visible (shown or being shown).
34 bool IsVisible();
35
36 private:
37 // Sets app list widget. If we are in visible mode, start showing animation.
38 // Otherwise, we just close the widget.
39 void SetWidget(views::Widget* widget);
40
41 // Forgets the widget.
42 void ResetWidget();
43
44 // Starts show/hide animation.
45 void ScheduleAnimation();
46
47 // aura::EventFilter overrides:
48 virtual bool PreHandleKeyEvent(aura::Window* target,
49 aura::KeyEvent* event) OVERRIDE;
50 virtual bool PreHandleMouseEvent(aura::Window* target,
51 aura::MouseEvent* event) OVERRIDE;
52 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
53 aura::TouchEvent* event) OVERRIDE;
54
55 // ui::LayerAnimationObserver overrides:
56 virtual void OnLayerAnimationEnded(
57 const ui::LayerAnimationSequence* sequence) OVERRIDE;
58 virtual void OnLayerAnimationAborted(
59 const ui::LayerAnimationSequence* sequence) OVERRIDE;
60 virtual void OnLayerAnimationScheduled(
61 const ui::LayerAnimationSequence* sequence) OVERRIDE;
62
63 // views::Widget::Observer overrides:
64 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
65 virtual void OnWidgetActivationChanged(views::Widget* widget,
66 bool active) OVERRIDE;
67
68 // Whether we should show or hide app list widget.
69 bool is_visible_;
70
71 // App list widget we get from ShellDelegate.
72 views::Widget* widget_;
73
74 // A weak ptr factory for callbacks that ShellDelegate used to set widget.
75 base::WeakPtrFactory<AppList> set_widget_factory_;
76
77 DISALLOW_COPY_AND_ASSIGN(AppList);
78 };
79
80 } // namespace internal
81 } // namespace aura_shell
82
83 #endif // UI_AURA_SHELL_APP_LIST_H_
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/app_list/Preferences ('k') | ui/aura_shell/app_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698