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