| 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" |
| 11 #include "ash/public/interfaces/user_window_controller.mojom.h" |
| 10 #include "ash/shelf/shelf_delegate.h" | 12 #include "ash/shelf/shelf_delegate.h" |
| 11 #include "mash/shelf/public/interfaces/shelf.mojom.h" | 13 #include "mash/shelf/public/interfaces/shelf.mojom.h" |
| 12 #include "mash/wm/public/interfaces/shelf_layout.mojom.h" | |
| 13 #include "mash/wm/public/interfaces/user_window_controller.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 mash::wm::mojom::UserWindowObserver { | 27 public 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 12 matching lines...) Expand all Loading... |
| 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, | 57 void SetItemImage(const mojo::String& app_id, |
| 58 skia::mojom::BitmapPtr image) override; | 58 skia::mojom::BitmapPtr image) override; |
| 59 | 59 |
| 60 // mash::wm::mojom::UserWindowObserver: | 60 // mojom::UserWindowObserver: |
| 61 void OnUserWindowObserverAdded( | 61 void OnUserWindowObserverAdded( |
| 62 mojo::Array<mash::wm::mojom::UserWindowPtr> user_windows) override; | 62 mojo::Array<mojom::UserWindowPtr> user_windows) override; |
| 63 void OnUserWindowAdded(mash::wm::mojom::UserWindowPtr user_window) override; | 63 void OnUserWindowAdded(mojom::UserWindowPtr user_window) override; |
| 64 void OnUserWindowRemoved(uint32_t window_id) override; | 64 void OnUserWindowRemoved(uint32_t window_id) override; |
| 65 void OnUserWindowTitleChanged(uint32_t window_id, | 65 void OnUserWindowTitleChanged(uint32_t window_id, |
| 66 const mojo::String& window_title) override; | 66 const mojo::String& window_title) override; |
| 67 void OnUserWindowAppIconChanged(uint32_t window_id, | 67 void OnUserWindowAppIconChanged(uint32_t window_id, |
| 68 mojo::Array<uint8_t> app_icon) override; | 68 mojo::Array<uint8_t> app_icon) override; |
| 69 void OnUserWindowFocusChanged(uint32_t window_id, bool has_focus) override; | 69 void OnUserWindowFocusChanged(uint32_t window_id, bool has_focus) override; |
| 70 | 70 |
| 71 // Set the Mus window preferred sizes, needed by mash::wm::ShelfLayout. | 71 // Set the Mus window preferred sizes, needed by mash::wm::ShelfLayout. |
| 72 void SetShelfPreferredSizes(Shelf* shelf); | 72 void SetShelfPreferredSizes(Shelf* shelf); |
| 73 | 73 |
| 74 ShelfModel* model_; | 74 ShelfModel* model_; |
| 75 | 75 |
| 76 mojo::AssociatedInterfacePtrSet<mash::shelf::mojom::ShelfObserver> observers_; | 76 mojo::AssociatedInterfacePtrSet<mash::shelf::mojom::ShelfObserver> observers_; |
| 77 | 77 |
| 78 mash::wm::mojom::ShelfLayoutPtr shelf_layout_; | 78 mojom::ShelfLayoutPtr shelf_layout_; |
| 79 mash::wm::mojom::UserWindowControllerPtr user_window_controller_; | 79 mojom::UserWindowControllerPtr user_window_controller_; |
| 80 mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_; | 80 mojo::Binding<mojom::UserWindowObserver> binding_; |
| 81 std::map<uint32_t, ShelfID> window_id_to_shelf_id_; | 81 std::map<uint32_t, ShelfID> window_id_to_shelf_id_; |
| 82 | 82 |
| 83 std::map<std::string, ShelfID> app_id_to_shelf_id_; | 83 std::map<std::string, ShelfID> app_id_to_shelf_id_; |
| 84 std::map<ShelfID, std::string> shelf_id_to_app_id_; | 84 std::map<ShelfID, std::string> shelf_id_to_app_id_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus); | 86 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace sysui | 89 } // namespace sysui |
| 90 } // namespace ash | 90 } // namespace ash |
| 91 | 91 |
| 92 #endif // ASH_SYSUI_SHELF_DELEGATE_MUS_H_ | 92 #endif // ASH_SYSUI_SHELF_DELEGATE_MUS_H_ |
| OLD | NEW |