Avery Musbach | 2041a09 | 2021-11-19 00:03:57 | [diff] [blame^] | 1 | // Copyright 2021 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_SHELF_SHELF_PARTY_FEATURE_POD_CONTROLLER_H_ |
| 6 | #define ASH_SHELF_SHELF_PARTY_FEATURE_POD_CONTROLLER_H_ |
| 7 | |
| 8 | #include "ash/ash_export.h" |
| 9 | #include "ash/public/cpp/session/session_observer.h" |
| 10 | #include "ash/public/cpp/shelf_model_observer.h" |
| 11 | #include "ash/system/unified/feature_pod_controller_base.h" |
| 12 | |
| 13 | namespace ash { |
| 14 | |
| 15 | // Controller of a feature pod button that toggles shelf party mode. |
| 16 | class ASH_EXPORT ShelfPartyFeaturePodController |
| 17 | : public FeaturePodControllerBase, |
| 18 | public SessionObserver, |
| 19 | public ShelfModelObserver { |
| 20 | public: |
| 21 | ShelfPartyFeaturePodController(); |
| 22 | ShelfPartyFeaturePodController(const ShelfPartyFeaturePodController&) = |
| 23 | delete; |
| 24 | ShelfPartyFeaturePodController& operator=( |
| 25 | const ShelfPartyFeaturePodController&) = delete; |
| 26 | ~ShelfPartyFeaturePodController() override; |
| 27 | |
| 28 | // FeaturePodControllerBase: |
| 29 | FeaturePodButton* CreateButton() override; |
| 30 | void OnIconPressed() override; |
| 31 | SystemTrayItemUmaType GetUmaType() const override; |
| 32 | |
| 33 | // SessionObserver: |
| 34 | void OnSessionStateChanged(session_manager::SessionState state) override; |
| 35 | |
| 36 | // ShelfModelObserver: |
| 37 | void ShelfPartyToggled(bool in_shelf_party) override; |
| 38 | |
| 39 | private: |
| 40 | void UpdateButton(); |
| 41 | |
| 42 | FeaturePodButton* button_ = nullptr; |
| 43 | }; |
| 44 | |
| 45 | } // namespace ash |
| 46 | |
| 47 | #endif // ASH_SHELF_SHELF_PARTY_FEATURE_POD_CONTROLLER_H_ |