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_SHELL_LAUNCHER_DELEGATE_IMPL_H_ | 5 #ifndef ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ |
6 #define ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ | 6 #define ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include "ash/launcher/launcher_delegate.h" | 8 #include "ash/launcher/launcher_delegate.h" |
| 9 #include "ash/launcher/launcher_item_delegate.h" |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
10 | 11 |
11 namespace aura { | 12 namespace aura { |
12 class Window; | 13 class Window; |
13 } | 14 } |
14 | 15 |
15 namespace ash { | 16 namespace ash { |
16 namespace shell { | 17 namespace shell { |
17 | 18 |
18 class WindowWatcher; | 19 class WindowWatcher; |
19 | 20 |
20 class LauncherDelegateImpl : public ash::LauncherDelegate { | 21 class LauncherDelegateImpl : public ash::LauncherDelegate, |
| 22 public ash::LauncherItemDelegate { |
21 public: | 23 public: |
22 explicit LauncherDelegateImpl(WindowWatcher* watcher); | 24 explicit LauncherDelegateImpl(WindowWatcher* watcher); |
23 virtual ~LauncherDelegateImpl(); | 25 virtual ~LauncherDelegateImpl(); |
24 | 26 |
25 void set_watcher(WindowWatcher* watcher) { watcher_ = watcher; } | 27 void set_watcher(WindowWatcher* watcher) { watcher_ = watcher; } |
26 | 28 |
27 // LauncherDelegate overrides: | 29 // LauncherDelegate overrides: |
28 virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE; | 30 virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE; |
29 virtual void OnLauncherCreated(Launcher* launcher) OVERRIDE; | 31 virtual void OnLauncherCreated(Launcher* launcher) OVERRIDE; |
30 virtual void OnLauncherDestroyed(Launcher* launcher) OVERRIDE; | 32 virtual void OnLauncherDestroyed(Launcher* launcher) OVERRIDE; |
31 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) OVERRIDE; | 33 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) OVERRIDE; |
32 virtual const std::string& GetAppIDForLauncherID(LauncherID id) OVERRIDE; | 34 virtual const std::string& GetAppIDForLauncherID(LauncherID id) OVERRIDE; |
33 virtual void PinAppWithID(const std::string& app_id) OVERRIDE; | 35 virtual void PinAppWithID(const std::string& app_id) OVERRIDE; |
34 virtual bool IsAppPinned(const std::string& app_id) OVERRIDE; | 36 virtual bool IsAppPinned(const std::string& app_id) OVERRIDE; |
35 virtual bool CanPin() const OVERRIDE; | 37 virtual bool CanPin() const OVERRIDE; |
36 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; | 38 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; |
37 | 39 |
| 40 // LauncherItemDelegate overrides: |
| 41 virtual void ItemSelected(const ash::LauncherItem& item, |
| 42 const ui::Event& event) OVERRIDE; |
| 43 virtual base::string16 GetTitle(const ash::LauncherItem& item) OVERRIDE; |
| 44 virtual ui::MenuModel* CreateContextMenu( |
| 45 const ash::LauncherItem& item, |
| 46 aura::RootWindow* root) OVERRIDE; |
| 47 virtual ash::LauncherMenuModel* CreateApplicationMenu( |
| 48 const ash::LauncherItem&, |
| 49 int event_flags) OVERRIDE; |
| 50 virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE; |
| 51 virtual bool ShouldShowTooltip(const LauncherItem& item) OVERRIDE; |
| 52 |
38 private: | 53 private: |
39 // Used to update Launcher. Owned by main. | 54 // Used to update Launcher. Owned by main. |
40 WindowWatcher* watcher_; | 55 WindowWatcher* watcher_; |
41 | 56 |
42 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl); | 57 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl); |
43 }; | 58 }; |
44 | 59 |
45 } // namespace shell | 60 } // namespace shell |
46 } // namespace ash | 61 } // namespace ash |
47 | 62 |
48 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ | 63 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ |
OLD | NEW |