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

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

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for unittest.. Created 7 years, 2 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
« no previous file with comments | « ash/shell.cc ('k') | ash/shell/launcher_delegate_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
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 bool CanPin() const OVERRIDE; 35 virtual bool CanPin() const OVERRIDE;
38 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; 36 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE;
39 37
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
53 private: 38 private:
54 // Used to update Launcher. Owned by main. 39 // Used to update Launcher. Owned by main.
55 WindowWatcher* watcher_; 40 WindowWatcher* watcher_;
56 41
57 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl); 42 DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl);
58 }; 43 };
59 44
60 } // namespace shell 45 } // namespace shell
61 } // namespace ash 46 } // namespace ash
62 47
63 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_ 48 #endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/shell/launcher_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698