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

Side by Side Diff: ash/public/cpp/shelf_model.h

Issue 2917013002: mash: Move ShelfModel* to ash/public/cpp. (Closed)
Patch Set: Initialize the AppList item title in ShelfController. Created 3 years, 6 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 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_PUBLIC_CPP_SHELF_MODEL_H_
6 #define ASH_SHELF_SHELF_MODEL_H_ 6 #define ASH_PUBLIC_CPP_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/public/cpp/ash_public_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 // An id for the AppList item, which is added in the ShelfModel constructor. 22 // An id for the AppList item, which is added in the ShelfModel constructor.
23 // Generated as crx_file::id_util::GenerateId("org.chromium.applist") 23 // Generated as crx_file::id_util::GenerateId("org.chromium.applist")
24 ASH_EXPORT extern const char kAppListId[]; 24 ASH_PUBLIC_EXPORT extern const char kAppListId[];
25 25
26 // Model used for shelf items. Owns ShelfItemDelegates but does not create them. 26 // Model used for shelf items. Owns ShelfItemDelegates but does not create them.
27 // TODO(msw): Move this to ash/public/cpp and use ASH_PUBLIC_EXPORT. 27 class ASH_PUBLIC_EXPORT ShelfModel {
28 class ASH_EXPORT ShelfModel {
29 public: 28 public:
30 ShelfModel(); 29 ShelfModel();
31 ~ShelfModel(); 30 ~ShelfModel();
32 31
33 // Pins an app with |app_id| to shelf. A running instance will get pinned. 32 // Pins an app with |app_id| to shelf. A running instance will get pinned.
34 // If there is no running instance, a new shelf item is created and pinned. 33 // If there is no running instance, a new shelf item is created and pinned.
35 void PinAppWithID(const std::string& app_id); 34 void PinAppWithID(const std::string& app_id);
36 35
37 // Check if the app with |app_id_| is pinned to the shelf. 36 // Check if the app with |app_id_| is pinned to the shelf.
38 bool IsAppPinned(const std::string& app_id); 37 bool IsAppPinned(const std::string& app_id);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 base::ObserverList<ShelfModelObserver> observers_; 102 base::ObserverList<ShelfModelObserver> observers_;
104 103
105 std::map<ShelfID, std::unique_ptr<ShelfItemDelegate>> 104 std::map<ShelfID, std::unique_ptr<ShelfItemDelegate>>
106 id_to_item_delegate_map_; 105 id_to_item_delegate_map_;
107 106
108 DISALLOW_COPY_AND_ASSIGN(ShelfModel); 107 DISALLOW_COPY_AND_ASSIGN(ShelfModel);
109 }; 108 };
110 109
111 } // namespace ash 110 } // namespace ash
112 111
113 #endif // ASH_SHELF_SHELF_MODEL_H_ 112 #endif // ASH_PUBLIC_CPP_SHELF_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698