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 { | |
13 class Rect; | |
14 } | |
15 | |
12 namespace views { | 16 namespace views { |
13 class Widget; | 17 class Widget; |
14 } | 18 } |
15 | 19 |
16 namespace aura_shell { | 20 namespace aura_shell { |
17 | 21 |
18 struct LauncherItem; | 22 struct LauncherItem; |
19 | 23 |
20 // Delegate of the Shell. | 24 // Delegate of the Shell. |
21 class AURA_SHELL_EXPORT ShellDelegate { | 25 class AURA_SHELL_EXPORT ShellDelegate { |
22 public: | 26 public: |
23 // Callback to pass back a widget used by RequestAppListWidget. | 27 // Callback to pass back a widget used by RequestAppListWidget. |
24 typedef base::Callback<void(views::Widget*)> SetWidgetCallback; | 28 typedef base::Callback<void(views::Widget*)> SetWidgetCallback; |
25 | 29 |
26 // The Shell owns the delegate. | 30 // The Shell owns the delegate. |
27 virtual ~ShellDelegate() {} | 31 virtual ~ShellDelegate() {} |
28 | 32 |
29 // 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 |
30 // window. | 34 // window. |
31 virtual void CreateNewWindow() = 0; | 35 virtual void CreateNewWindow() = 0; |
32 | 36 |
33 // Invoked to create a new status area. Can return NULL. | 37 // Invoked to create a new status area. Can return NULL. |
34 virtual views::Widget* CreateStatusArea() = 0; | 38 virtual views::Widget* CreateStatusArea() = 0; |
35 | 39 |
36 // Invoked to create app list widget. The Delegate calls the callback | 40 // Invoked to create app list widget. The Delegate calls the callback |
37 // when the widget is ready to show. | 41 // when the widget is ready to show. |
38 virtual void RequestAppListWidget(const SetWidgetCallback& callback) = 0; | 42 virtual void RequestAppListWidget(const gfx::Rect& bounds, |
sky
2011/11/30 21:50:21
nit: wrap to next line.
xiyuan
2011/11/30 22:26:34
Done.
| |
43 const SetWidgetCallback& callback) = 0; | |
39 | 44 |
40 // Invoked when the user clicks on a window entry in the launcher. | 45 // Invoked when the user clicks on a window entry in the launcher. |
41 virtual void LauncherItemClicked(const LauncherItem& item) = 0; | 46 virtual void LauncherItemClicked(const LauncherItem& item) = 0; |
42 | 47 |
43 // Invoked when a window is added. If the delegate wants the launcher to show | 48 // Invoked when a window is added. If the delegate wants the launcher to show |
44 // an entry for |item->window| it should configure |item| appropriately and | 49 // an entry for |item->window| it should configure |item| appropriately and |
45 // return true. | 50 // return true. |
46 virtual bool ConfigureLauncherItem(LauncherItem* item) = 0; | 51 virtual bool ConfigureLauncherItem(LauncherItem* item) = 0; |
47 }; | 52 }; |
48 | 53 |
49 } // namespace aura_shell | 54 } // namespace aura_shell |
50 | 55 |
51 #endif // UI_AURA_SHELL_SHELL_DELEGATE_H_ | 56 #endif // UI_AURA_SHELL_SHELL_DELEGATE_H_ |
OLD | NEW |