OLD | NEW |
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_SHELF_SHELF_MODEL_H_ | 5 #ifndef ASH_SHELF_SHELF_MODEL_H_ |
6 #define ASH_SHELF_SHELF_MODEL_H_ | 6 #define ASH_SHELF_SHELF_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/public/cpp/shelf_item.h" | 12 #include "ash/public/cpp/shelf_item.h" |
13 #include "ash/public/interfaces/shelf.mojom.h" | 13 #include "ash/public/interfaces/shelf.mojom.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 class ShelfItemDelegate; | 19 class ShelfItemDelegate; |
20 class ShelfModelObserver; | 20 class ShelfModelObserver; |
21 | 21 |
22 // Model used for shelf items. Owns ShelfItemDelegates but does not create them. | 22 // Model used for shelf items. Owns ShelfItemDelegates but does not create them. |
23 // TODO(msw): Remove id conversion functions; check for item presence as needed. | |
24 class ASH_EXPORT ShelfModel { | 23 class ASH_EXPORT ShelfModel { |
25 public: | 24 public: |
26 ShelfModel(); | 25 ShelfModel(); |
27 ~ShelfModel(); | 26 ~ShelfModel(); |
28 | 27 |
29 // Pins an app with |app_id| to shelf. A running instance will get pinned. | 28 // Pins an app with |app_id| to shelf. A running instance will get pinned. |
30 // In case there is no running instance a new shelf item is created and | 29 // In case there is no running instance a new shelf item is created and |
31 // pinned. | 30 // pinned. |
32 void PinAppWithID(const std::string& app_id); | 31 void PinAppWithID(const std::string& app_id); |
33 | 32 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 100 |
102 std::map<ShelfID, std::unique_ptr<ShelfItemDelegate>> | 101 std::map<ShelfID, std::unique_ptr<ShelfItemDelegate>> |
103 id_to_item_delegate_map_; | 102 id_to_item_delegate_map_; |
104 | 103 |
105 DISALLOW_COPY_AND_ASSIGN(ShelfModel); | 104 DISALLOW_COPY_AND_ASSIGN(ShelfModel); |
106 }; | 105 }; |
107 | 106 |
108 } // namespace ash | 107 } // namespace ash |
109 | 108 |
110 #endif // ASH_SHELF_SHELF_MODEL_H_ | 109 #endif // ASH_SHELF_SHELF_MODEL_H_ |
OLD | NEW |