OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_SYSTEM_CAST_TRAY_CAST_H_ |
| 6 #define ASH_SYSTEM_CAST_TRAY_CAST_H_ |
| 7 |
| 8 #include "ash/shell_observer.h" |
| 9 #include "ash/system/tray/system_tray_item.h" |
| 10 |
| 11 namespace ash { |
| 12 namespace tray { |
| 13 class CastTrayView; |
| 14 class CastSelectDefaultView; |
| 15 class CastDetailedView; |
| 16 class CastDuplexView; |
| 17 } // namespace tray |
| 18 |
| 19 class CastConfigDelegate; |
| 20 |
| 21 class TrayCast : public SystemTrayItem, public ShellObserver { |
| 22 public: |
| 23 explicit TrayCast(SystemTray* system_tray); |
| 24 ~TrayCast() override; |
| 25 |
| 26 private: |
| 27 bool HasCastExtension(); |
| 28 |
| 29 // Overridden from SystemTrayItem. |
| 30 views::View* CreateTrayView(user::LoginStatus status) override; |
| 31 views::View* CreateDefaultView(user::LoginStatus status) override; |
| 32 views::View* CreateDetailedView(user::LoginStatus status) override; |
| 33 void DestroyTrayView() override; |
| 34 void DestroyDefaultView() override; |
| 35 void DestroyDetailedView() override; |
| 36 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; |
| 37 |
| 38 // Overridden from ShellObserver. |
| 39 void OnCastingSessionStartedOrStopped(bool started) override; |
| 40 |
| 41 // This makes sure that the current view displayed in the tray is the correct |
| 42 // one, depending on if we are currently casting. If we're casting, then a |
| 43 // view with a stop button is displayed; otherwise, a view that links to a |
| 44 // detail view is displayed instead that allows the user to easily begin a |
| 45 // casting session. |
| 46 void UpdatePrimaryView(); |
| 47 |
| 48 bool is_casting_ = false; |
| 49 |
| 50 // Not owned. |
| 51 tray::CastTrayView* tray_ = nullptr; |
| 52 tray::CastDuplexView* default_ = nullptr; |
| 53 tray::CastDetailedView* detailed_ = nullptr; |
| 54 CastConfigDelegate* cast_config_delegate_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(TrayCast); |
| 57 }; |
| 58 |
| 59 } // namespace ash |
| 60 |
| 61 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ |
OLD | NEW |