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

Side by Side Diff: mash/shelf/shelf_model.h

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 | « mash/shelf/shelf_application.cc ('k') | mash/shelf/shelf_model.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 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
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_
OLDNEW
« no previous file with comments | « mash/shelf/shelf_application.cc ('k') | mash/shelf/shelf_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698