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 MASH_SHELF_SHELF_MODEL_H_ | 5 #ifndef MASH_SHELF_SHELF_MODEL_H_ |
6 #define MASH_SHELF_SHELF_MODEL_H_ | 6 #define MASH_SHELF_SHELF_MODEL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "mash/shelf/shelf_item_types.h" | 10 #include "mash/shelf/shelf_item_types.h" |
11 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" | 11 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class ApplicationImpl; | 15 class Shell; |
16 } | 16 } |
17 | 17 |
18 namespace mash { | 18 namespace mash { |
19 namespace shelf { | 19 namespace shelf { |
20 | 20 |
21 class ShelfModelObserver; | 21 class ShelfModelObserver; |
22 | 22 |
23 // Model used by ShelfView. | 23 // Model used by ShelfView. |
24 class ShelfModel : public mash::wm::mojom::UserWindowObserver { | 24 class ShelfModel : public mash::wm::mojom::UserWindowObserver { |
25 public: | 25 public: |
26 enum Status { | 26 enum Status { |
27 STATUS_NORMAL, | 27 STATUS_NORMAL, |
28 // A status that indicates apps are syncing/loading. | 28 // A status that indicates apps are syncing/loading. |
29 STATUS_LOADING, | 29 STATUS_LOADING, |
30 }; | 30 }; |
31 | 31 |
32 explicit ShelfModel(mojo::ApplicationImpl* app); | 32 explicit ShelfModel(mojo::Shell* shell); |
33 ~ShelfModel() override; | 33 ~ShelfModel() override; |
34 | 34 |
35 // Adds a new item to the model. Returns the resulting index. | 35 // Adds a new item to the model. Returns the resulting index. |
36 int Add(const ShelfItem& item); | 36 int Add(const ShelfItem& item); |
37 | 37 |
38 // Adds the item. |index| is the requested insertion index, which may be | 38 // Adds the item. |index| is the requested insertion index, which may be |
39 // modified to meet type-based ordering. Returns the actual insertion index. | 39 // modified to meet type-based ordering. Returns the actual insertion index. |
40 int AddAt(int index, const ShelfItem& item); | 40 int AddAt(int index, const ShelfItem& item); |
41 | 41 |
42 // Removes the item at |index|. | 42 // Removes the item at |index|. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 mash::wm::mojom::UserWindowControllerPtr user_window_controller_; | 119 mash::wm::mojom::UserWindowControllerPtr user_window_controller_; |
120 mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_; | 120 mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(ShelfModel); | 122 DISALLOW_COPY_AND_ASSIGN(ShelfModel); |
123 }; | 123 }; |
124 | 124 |
125 } // namespace shelf | 125 } // namespace shelf |
126 } // namespace mash | 126 } // namespace mash |
127 | 127 |
128 #endif // MASH_SHELF_SHELF_MODEL_H_ | 128 #endif // MASH_SHELF_SHELF_MODEL_H_ |
OLD | NEW |