OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_SYSUI_SHELF_DELEGATE_MUS_H_ | 5 #ifndef ASH_SYSUI_SHELF_DELEGATE_MUS_H_ |
6 #define ASH_SYSUI_SHELF_DELEGATE_MUS_H_ | 6 #define ASH_SYSUI_SHELF_DELEGATE_MUS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/public/interfaces/shelf_layout.mojom.h" | 10 #include "ash/public/interfaces/shelf_layout.mojom.h" |
11 #include "ash/public/interfaces/user_window_controller.mojom.h" | 11 #include "ash/public/interfaces/user_window_controller.mojom.h" |
12 #include "ash/shelf/shelf_delegate.h" | 12 #include "ash/shelf/shelf_delegate.h" |
13 #include "mash/shelf/public/interfaces/shelf.mojom.h" | 13 #include "mash/shelf/public/interfaces/shelf.mojom.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
15 #include "mojo/public/cpp/bindings/interface_ptr_set.h" | 15 #include "mojo/public/cpp/bindings/interface_ptr_set.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 class ShelfModel; | 19 class ShelfModel; |
20 | 20 |
21 namespace sysui { | 21 namespace sysui { |
22 | 22 |
23 // Manages communication between the ash_sysui shelf, the window manager, and | 23 // Manages communication between the ash_sysui shelf, the window manager, and |
24 // the browser. | 24 // the browser. |
25 class ShelfDelegateMus : public ShelfDelegate, | 25 class ShelfDelegateMus : public ShelfDelegate, |
26 public mash::shelf::mojom::ShelfController, | 26 public mash::shelf::mojom::ShelfController, |
27 public mojom::UserWindowObserver { | 27 public ash::mojom::UserWindowObserver { |
28 public: | 28 public: |
29 explicit ShelfDelegateMus(ShelfModel* model); | 29 explicit ShelfDelegateMus(ShelfModel* model); |
30 ~ShelfDelegateMus() override; | 30 ~ShelfDelegateMus() override; |
31 | 31 |
32 private: | 32 private: |
33 // ShelfDelegate: | 33 // ShelfDelegate: |
34 void OnShelfCreated(Shelf* shelf) override; | 34 void OnShelfCreated(Shelf* shelf) override; |
35 void OnShelfDestroyed(Shelf* shelf) override; | 35 void OnShelfDestroyed(Shelf* shelf) override; |
36 void OnShelfAlignmentChanged(Shelf* shelf) override; | 36 void OnShelfAlignmentChanged(Shelf* shelf) override; |
37 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override; | 37 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override; |
(...skipping 11 matching lines...) Expand all Loading... |
49 mash::shelf::mojom::ShelfObserverAssociatedPtrInfo observer) override; | 49 mash::shelf::mojom::ShelfObserverAssociatedPtrInfo observer) override; |
50 void SetAlignment(mash::shelf::mojom::Alignment alignment) override; | 50 void SetAlignment(mash::shelf::mojom::Alignment alignment) override; |
51 void SetAutoHideBehavior( | 51 void SetAutoHideBehavior( |
52 mash::shelf::mojom::AutoHideBehavior auto_hide) override; | 52 mash::shelf::mojom::AutoHideBehavior auto_hide) override; |
53 void PinItem( | 53 void PinItem( |
54 mash::shelf::mojom::ShelfItemPtr item, | 54 mash::shelf::mojom::ShelfItemPtr item, |
55 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override; | 55 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override; |
56 void UnpinItem(const mojo::String& app_id) override; | 56 void UnpinItem(const mojo::String& app_id) override; |
57 void SetItemImage(const mojo::String& app_id, const SkBitmap& image) override; | 57 void SetItemImage(const mojo::String& app_id, const SkBitmap& image) override; |
58 | 58 |
59 // mojom::UserWindowObserver: | 59 // ash::mojom::UserWindowObserver: |
60 void OnUserWindowObserverAdded( | 60 void OnUserWindowObserverAdded( |
61 mojo::Array<mojom::UserWindowPtr> user_windows) override; | 61 mojo::Array<ash::mojom::UserWindowPtr> user_windows) override; |
62 void OnUserWindowAdded(mojom::UserWindowPtr user_window) override; | 62 void OnUserWindowAdded(ash::mojom::UserWindowPtr user_window) override; |
63 void OnUserWindowRemoved(uint32_t window_id) override; | 63 void OnUserWindowRemoved(uint32_t window_id) override; |
64 void OnUserWindowTitleChanged(uint32_t window_id, | 64 void OnUserWindowTitleChanged(uint32_t window_id, |
65 const mojo::String& window_title) override; | 65 const mojo::String& window_title) override; |
66 void OnUserWindowAppIconChanged(uint32_t window_id, | 66 void OnUserWindowAppIconChanged(uint32_t window_id, |
67 mojo::Array<uint8_t> app_icon) override; | 67 mojo::Array<uint8_t> app_icon) override; |
68 void OnUserWindowFocusChanged(uint32_t window_id, bool has_focus) override; | 68 void OnUserWindowFocusChanged(uint32_t window_id, bool has_focus) override; |
69 | 69 |
70 // Set the Mus window preferred sizes, needed by mash::wm::ShelfLayout. | 70 // Set the Mus window preferred sizes, needed by mash::wm::ShelfLayout. |
71 void SetShelfPreferredSizes(Shelf* shelf); | 71 void SetShelfPreferredSizes(Shelf* shelf); |
72 | 72 |
73 ShelfModel* model_; | 73 ShelfModel* model_; |
74 | 74 |
75 mojo::AssociatedInterfacePtrSet<mash::shelf::mojom::ShelfObserver> observers_; | 75 mojo::AssociatedInterfacePtrSet<mash::shelf::mojom::ShelfObserver> observers_; |
76 | 76 |
77 mojom::ShelfLayoutPtr shelf_layout_; | 77 ash::mojom::ShelfLayoutPtr shelf_layout_; |
78 mojom::UserWindowControllerPtr user_window_controller_; | 78 ash::mojom::UserWindowControllerPtr user_window_controller_; |
79 mojo::Binding<mojom::UserWindowObserver> binding_; | 79 mojo::Binding<ash::mojom::UserWindowObserver> binding_; |
80 std::map<uint32_t, ShelfID> window_id_to_shelf_id_; | 80 std::map<uint32_t, ShelfID> window_id_to_shelf_id_; |
81 | 81 |
82 std::map<std::string, ShelfID> app_id_to_shelf_id_; | 82 std::map<std::string, ShelfID> app_id_to_shelf_id_; |
83 std::map<ShelfID, std::string> shelf_id_to_app_id_; | 83 std::map<ShelfID, std::string> shelf_id_to_app_id_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus); | 85 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace sysui | 88 } // namespace sysui |
89 } // namespace ash | 89 } // namespace ash |
90 | 90 |
91 #endif // ASH_SYSUI_SHELF_DELEGATE_MUS_H_ | 91 #endif // ASH_SYSUI_SHELF_DELEGATE_MUS_H_ |
OLD | NEW |