OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 UI_AURA_SHELL_SHELL_DELEGATE_H_ | 5 #ifndef UI_AURA_SHELL_SHELL_DELEGATE_H_ |
6 #define UI_AURA_SHELL_SHELL_DELEGATE_H_ | 6 #define UI_AURA_SHELL_SHELL_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "ui/aura_shell/aura_shell_export.h" | 10 #include "ui/aura_shell/aura_shell_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class Rect; | 13 class Rect; |
14 } | 14 } |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class Widget; | 17 class Widget; |
18 } | 18 } |
19 | 19 |
20 namespace aura_shell { | 20 namespace aura_shell { |
21 | 21 |
22 class AppListModel; | |
23 class AppListViewDelegate; | |
24 struct LauncherItem; | 22 struct LauncherItem; |
25 | 23 |
26 // Delegate of the Shell. | 24 // Delegate of the Shell. |
27 class AURA_SHELL_EXPORT ShellDelegate { | 25 class AURA_SHELL_EXPORT ShellDelegate { |
28 public: | 26 public: |
29 // Callback to pass back a widget used by RequestAppListWidget. | 27 // Callback to pass back a widget used by RequestAppListWidget. |
30 typedef base::Callback<void(views::Widget*)> SetWidgetCallback; | 28 typedef base::Callback<void(views::Widget*)> SetWidgetCallback; |
31 | 29 |
32 // The Shell owns the delegate. | 30 // The Shell owns the delegate. |
33 virtual ~ShellDelegate() {} | 31 virtual ~ShellDelegate() {} |
34 | 32 |
35 // Invoked when the user clicks on button in the launcher to create a new | 33 // Invoked when the user clicks on button in the launcher to create a new |
36 // window. | 34 // window. |
37 virtual void CreateNewWindow() = 0; | 35 virtual void CreateNewWindow() = 0; |
38 | 36 |
39 // Invoked to create a new status area. Can return NULL. | 37 // Invoked to create a new status area. Can return NULL. |
40 virtual views::Widget* CreateStatusArea() = 0; | 38 virtual views::Widget* CreateStatusArea() = 0; |
41 | 39 |
42 // Invoked to create app list widget. The Delegate calls the callback | 40 // Invoked to create app list widget. The Delegate calls the callback |
43 // when the widget is ready to show. | 41 // when the widget is ready to show. |
44 // Deprecated. | |
45 // TODO(xiyuan): Clean this up when switching to views app list. | |
46 virtual void RequestAppListWidget( | 42 virtual void RequestAppListWidget( |
47 const gfx::Rect& bounds, | 43 const gfx::Rect& bounds, |
48 const SetWidgetCallback& callback) = 0; | 44 const SetWidgetCallback& callback) = 0; |
49 | 45 |
50 // Invoked to ask the delegate to populate the |model|. | |
51 virtual void BuildAppListModel(AppListModel* model) = 0; | |
52 | |
53 // Invoked to create an AppListViewDelegate. Shell takes the ownership of | |
54 // the created delegate. | |
55 virtual AppListViewDelegate* CreateAppListViewDelegate() = 0; | |
56 | |
57 // Invoked when the user clicks on a window entry in the launcher. | 46 // Invoked when the user clicks on a window entry in the launcher. |
58 virtual void LauncherItemClicked(const LauncherItem& item) = 0; | 47 virtual void LauncherItemClicked(const LauncherItem& item) = 0; |
59 | 48 |
60 // Invoked when a window is added. If the delegate wants the launcher to show | 49 // Invoked when a window is added. If the delegate wants the launcher to show |
61 // an entry for |item->window| it should configure |item| appropriately and | 50 // an entry for |item->window| it should configure |item| appropriately and |
62 // return true. | 51 // return true. |
63 virtual bool ConfigureLauncherItem(LauncherItem* item) = 0; | 52 virtual bool ConfigureLauncherItem(LauncherItem* item) = 0; |
64 }; | 53 }; |
65 } // namespace aura_shell | 54 } // namespace aura_shell |
66 | 55 |
67 #endif // UI_AURA_SHELL_SHELL_DELEGATE_H_ | 56 #endif // UI_AURA_SHELL_SHELL_DELEGATE_H_ |
OLD | NEW |