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

Side by Side Diff: ash/shell/launcher_delegate_impl.h

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for OpenBrowserUsingShelfOnOhterDisplay fail Created 7 years, 3 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
OLDNEW
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:
30 virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE;
31 virtual void OnLauncherCreated(Launcher* launcher) OVERRIDE;
32 virtual void OnLauncherDestroyed(Launcher* launcher) OVERRIDE;
33 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) OVERRIDE;
34 virtual const std::string& GetAppIDForLauncherID(LauncherID id) OVERRIDE;
35 virtual void PinAppWithID(const std::string& app_id) OVERRIDE;
36 virtual bool IsAppPinned(const std::string& app_id) OVERRIDE;
37 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE;
38
39 // LauncherItemDelegate overrides:
28 virtual void ItemSelected(const ash::LauncherItem& item, 40 virtual void ItemSelected(const ash::LauncherItem& item,
29 const ui::Event& event) OVERRIDE; 41 const ui::Event& event) OVERRIDE;
30 virtual base::string16 GetTitle(const ash::LauncherItem& item) OVERRIDE; 42 virtual base::string16 GetTitle(const ash::LauncherItem& item) OVERRIDE;
31 virtual ui::MenuModel* CreateContextMenu( 43 virtual ui::MenuModel* CreateContextMenu(
32 const ash::LauncherItem& item, 44 const ash::LauncherItem& item,
33 aura::RootWindow* root) OVERRIDE; 45 aura::RootWindow* root) OVERRIDE;
34 virtual ash::LauncherMenuModel* CreateApplicationMenu( 46 virtual ash::LauncherMenuModel* CreateApplicationMenu(
35 const ash::LauncherItem&, 47 const ash::LauncherItem&,
36 int event_flags) OVERRIDE; 48 int event_flags) OVERRIDE;
37 virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE;
38 virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE; 49 virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE;
39 virtual bool ShouldShowTooltip(const LauncherItem& item) OVERRIDE; 50 virtual bool ShouldShowTooltip(const LauncherItem& item) OVERRIDE;
40 virtual void OnLauncherCreated(Launcher* launcher) OVERRIDE;
41 virtual void OnLauncherDestroyed(Launcher* launcher) OVERRIDE;
42 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) OVERRIDE;
43 virtual const std::string& GetAppIDForLauncherID(LauncherID id) OVERRIDE;
44 virtual void PinAppWithID(const std::string& app_id) OVERRIDE;
45 virtual bool IsAppPinned(const std::string& app_id) OVERRIDE;
46 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE;
47 51
48 private: 52 private:
49 // Used to update Launcher. Owned by main. 53 // Used to update Launcher. Owned by main.
50 WindowWatcher* watcher_; 54 WindowWatcher* watcher_;
51 55
52 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl); 56 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl);
53 }; 57 };
54 58
55 } // namespace shell 59 } // namespace shell
56 } // namespace ash 60 } // namespace ash
57 61
58 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ 62 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698