OLD | NEW |
(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 CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_ |
| 7 |
| 8 #include "mash/shelf/public/interfaces/shelf.mojom.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 |
| 11 // ChromeMashShelfController manages chrome's interaction with the mash shelf. |
| 12 class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver, |
| 13 public mash::shelf::mojom::ShelfItemDelegate { |
| 14 public: |
| 15 ~ChromeMashShelfController() override; |
| 16 |
| 17 // Creates an instance. |
| 18 static ChromeMashShelfController* CreateInstance(); |
| 19 |
| 20 // Returns the single ChromeMashShelfController instance. |
| 21 static ChromeMashShelfController* instance() { return instance_; } |
| 22 |
| 23 private: |
| 24 ChromeMashShelfController(); |
| 25 |
| 26 void Init(); |
| 27 |
| 28 // mash::shelf::mojom::ShelfObserver: |
| 29 void OnAlignmentChanged(mash::shelf::mojom::Alignment alignment) override; |
| 30 void OnAutoHideBehaviorChanged( |
| 31 mash::shelf::mojom::AutoHideBehavior auto_hide) override; |
| 32 |
| 33 // mash::shelf::mojom::ShelfItemDelegate: |
| 34 void ExecuteCommand(const mojo::String& id, |
| 35 uint32_t command_id, |
| 36 int32_t event_flags) override; |
| 37 void ItemRemoved(const mojo::String& id) override; |
| 38 void ItemReordered(const mojo::String& id, uint32_t order) override; |
| 39 |
| 40 static ChromeMashShelfController* instance_; |
| 41 |
| 42 mash::shelf::mojom::ShelfPtr shelf_; |
| 43 mojo::Binding<mash::shelf::mojom::ShelfObserver> observer_binding_; |
| 44 mojo::Binding<mash::shelf::mojom::ShelfItemDelegate> item_delegate_binding_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromeMashShelfController); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_ |
OLD | NEW |