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

Side by Side Diff: ash/shelf/shelf_item_delegate_manager.h

Issue 97173003: ash: Rename more Launcher classes to Shelf*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: link chrome Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « ash/shelf/shelf_item_delegate.h ('k') | ash/shelf/shelf_item_delegate_manager.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_LAUNCHER_LAUNCHER_ITEM_DELEGATE_MANAGER_H_ 5 #ifndef ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_
6 #define ASH_LAUNCHER_LAUNCHER_ITEM_DELEGATE_MANAGER_H_ 6 #define ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/launcher/launcher_types.h" 11 #include "ash/launcher/launcher_types.h"
12 #include "ash/shelf/shelf_model_observer.h" 12 #include "ash/shelf/shelf_model_observer.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 15
16 namespace ash { 16 namespace ash {
17 class LauncherItemDelegate; 17 class ShelfItemDelegate;
18 class ShelfModel; 18 class ShelfModel;
19 19
20 namespace test { 20 namespace test {
21 class LauncherItemDelegateManagerTestAPI; 21 class ShelfItemDelegateManagerTestAPI;
22 } 22 }
23 23
24 // LauncherItemDelegateManager manages the set of LauncherItemDelegates for the 24 // ShelfItemDelegateManager manages the set of ShelfItemDelegates for the
25 // launcher. LauncherItemDelegateManager does not create LauncherItemDelegates, 25 // launcher. ShelfItemDelegateManager does not create ShelfItemDelegates,
26 // rather it is expected that someone else invokes SetLauncherItemDelegate 26 // rather it is expected that someone else invokes SetShelfItemDelegate
27 // appropriately. On the other hand, LauncherItemDelegateManager destroys 27 // appropriately. On the other hand, ShelfItemDelegateManager destroys
28 // LauncherItemDelegates when the corresponding item from the model is removed. 28 // ShelfItemDelegates when the corresponding item from the model is removed.
29 class ASH_EXPORT LauncherItemDelegateManager : public ShelfModelObserver { 29 class ASH_EXPORT ShelfItemDelegateManager : public ShelfModelObserver {
30 public: 30 public:
31 explicit LauncherItemDelegateManager(ShelfModel* model); 31 explicit ShelfItemDelegateManager(ShelfModel* model);
32 virtual ~LauncherItemDelegateManager(); 32 virtual ~ShelfItemDelegateManager();
33 33
34 // Set |item_delegate| for |id| and take an ownership. 34 // Set |item_delegate| for |id| and take an ownership.
35 void SetLauncherItemDelegate( 35 void SetShelfItemDelegate(LauncherID id,
36 ash::LauncherID id, 36 scoped_ptr<ShelfItemDelegate> item_delegate);
37 scoped_ptr<ash::LauncherItemDelegate> item_delegate);
38 37
39 // Returns LauncherItemDelegate for |item_type|. Always returns non-NULL. 38 // Returns ShelfItemDelegate for |item_type|. Always returns non-NULL.
40 LauncherItemDelegate* GetLauncherItemDelegate(ash::LauncherID id); 39 ShelfItemDelegate* GetShelfItemDelegate(LauncherID id);
41 40
42 // ShelfModelObserver overrides: 41 // ShelfModelObserver overrides:
43 virtual void ShelfItemAdded(int model_index) OVERRIDE; 42 virtual void ShelfItemAdded(int model_index) OVERRIDE;
44 virtual void ShelfItemRemoved(int index, ash::LauncherID id) OVERRIDE; 43 virtual void ShelfItemRemoved(int index, LauncherID id) OVERRIDE;
45 virtual void ShelfItemMoved(int start_index, int targetindex) OVERRIDE; 44 virtual void ShelfItemMoved(int start_index, int targetindex) OVERRIDE;
46 virtual void ShelfItemChanged(int index, 45 virtual void ShelfItemChanged(int index,
47 const LauncherItem& old_item) OVERRIDE; 46 const LauncherItem& old_item) OVERRIDE;
48 virtual void ShelfStatusChanged() OVERRIDE; 47 virtual void ShelfStatusChanged() OVERRIDE;
49 48
50 private: 49 private:
51 friend class ash::test::LauncherItemDelegateManagerTestAPI; 50 friend class test::ShelfItemDelegateManagerTestAPI;
52 51
53 typedef std::map<ash::LauncherID, LauncherItemDelegate*> 52 typedef std::map<LauncherID, ShelfItemDelegate*> LauncherIDToItemDelegateMap;
54 LauncherIDToItemDelegateMap;
55 53
56 // Remove and destroy LauncherItemDelegate for |id|. 54 // Remove and destroy ShelfItemDelegate for |id|.
57 void RemoveLauncherItemDelegate(ash::LauncherID id); 55 void RemoveShelfItemDelegate(LauncherID id);
58 56
59 // Owned by Shell. 57 // Owned by Shell.
60 ShelfModel* model_; 58 ShelfModel* model_;
61 59
62 LauncherIDToItemDelegateMap id_to_item_delegate_map_; 60 LauncherIDToItemDelegateMap id_to_item_delegate_map_;
63 61
64 DISALLOW_COPY_AND_ASSIGN(LauncherItemDelegateManager); 62 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateManager);
65 }; 63 };
66 64
67 } // namespace ash 65 } // namespace ash
68 66
69 #endif // ASH_LAUNCHER_LAUNCHER_ITEM_DELEGATE_MANAGER_H_ 67 #endif // ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_item_delegate.h ('k') | ash/shelf/shelf_item_delegate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698