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

Side by Side Diff: ash/common/shelf/shelf_controller.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 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 | « ash/common/shelf/shelf_constants.cc ('k') | ash/common/shelf/shelf_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_SHELF_SHELF_CONTROLLER_H_
6 #define ASH_COMMON_SHELF_SHELF_CONTROLLER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "ash/common/shelf/shelf_item_types.h"
12 #include "ash/common/shelf/shelf_model.h"
13 #include "ash/public/cpp/shelf_types.h"
14 #include "ash/public/interfaces/shelf.mojom.h"
15 #include "mojo/public/cpp/bindings/binding_set.h"
16 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
17
18 namespace ash {
19
20 class WmShelf;
21
22 // Ash's implementation of the mojom::ShelfController interface. Chrome connects
23 // to this interface to observe and manage the per-display ash shelf instances.
24 class ShelfController : public mojom::ShelfController {
25 public:
26 ShelfController();
27 ~ShelfController() override;
28
29 // Binds the mojom::ShelfController interface request to this object.
30 void BindRequest(mojom::ShelfControllerRequest request);
31
32 ShelfModel* model() { return &model_; }
33
34 const std::map<std::string, ShelfID>& app_id_to_shelf_id() {
35 return app_id_to_shelf_id_;
36 }
37
38 const std::map<ShelfID, std::string>& shelf_id_to_app_id() {
39 return shelf_id_to_app_id_;
40 }
41
42 // Functions used to notify mojom::ShelfObserver instances of changes.
43 void NotifyShelfCreated(WmShelf* shelf);
44 void NotifyShelfAlignmentChanged(WmShelf* shelf);
45 void NotifyShelfAutoHideBehaviorChanged(WmShelf* shelf);
46
47 // mojom::Shelf:
48 void AddObserver(mojom::ShelfObserverAssociatedPtrInfo observer) override;
49 void SetAlignment(ShelfAlignment alignment, int64_t display_id) override;
50 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide,
51 int64_t display_id) override;
52 void PinItem(mojom::ShelfItemPtr item,
53 mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override;
54 void UnpinItem(const std::string& app_id) override;
55 void SetItemImage(const std::string& app_id, const SkBitmap& image) override;
56
57 private:
58 // The shelf model shared by all shelf instances.
59 ShelfModel model_;
60
61 // Bindings for the ShelfController interface.
62 mojo::BindingSet<mojom::ShelfController> bindings_;
63
64 // The set of shelf observers notified about shelf state and settings changes.
65 mojo::AssociatedInterfacePtrSet<mojom::ShelfObserver> observers_;
66
67 // Mappings between application and shelf ids.
68 std::map<std::string, ShelfID> app_id_to_shelf_id_;
69 std::map<ShelfID, std::string> shelf_id_to_app_id_;
70
71 DISALLOW_COPY_AND_ASSIGN(ShelfController);
72 };
73
74 } // namespace ash
75
76 #endif // ASH_COMMON_SHELF_SHELF_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_constants.cc ('k') | ash/common/shelf/shelf_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698