OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_SYSTEM_CAST_TRAY_CAST_H_ | 5 #ifndef ASH_SYSTEM_CAST_TRAY_CAST_H_ |
6 #define ASH_SYSTEM_CAST_TRAY_CAST_H_ | 6 #define ASH_SYSTEM_CAST_TRAY_CAST_H_ |
7 | 7 |
8 #include "ash/cast_config_delegate.h" | 8 #include "ash/cast_config_delegate.h" |
9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace tray { | 14 namespace tray { |
15 class CastTrayView; | 15 class CastTrayView; |
16 class CastSelectDefaultView; | 16 class CastSelectDefaultView; |
17 class CastDetailedView; | 17 class CastDetailedView; |
18 class CastDuplexView; | 18 class CastDuplexView; |
19 } // namespace tray | 19 } // namespace tray |
20 | 20 |
21 class TrayCast : public SystemTrayItem, public ShellObserver { | 21 class ASH_EXPORT TrayCast : public SystemTrayItem, public ShellObserver { |
22 public: | 22 public: |
23 explicit TrayCast(SystemTray* system_tray); | 23 explicit TrayCast(SystemTray* system_tray); |
24 ~TrayCast() override; | 24 ~TrayCast() override; |
25 | 25 |
26 private: | 26 private: |
| 27 // Helper/utility methods for testing. |
| 28 friend class TrayCastTestAPI; |
| 29 void StartCastForTest(const std::string& receiver_id); |
| 30 void StopCastForTest(); |
| 31 enum ChildViewIds { TRAY_VIEW, SELECT_VIEW, CAST_VIEW }; |
| 32 |
27 // Overridden from SystemTrayItem. | 33 // Overridden from SystemTrayItem. |
28 views::View* CreateTrayView(user::LoginStatus status) override; | 34 views::View* CreateTrayView(user::LoginStatus status) override; |
29 views::View* CreateDefaultView(user::LoginStatus status) override; | 35 views::View* CreateDefaultView(user::LoginStatus status) override; |
30 views::View* CreateDetailedView(user::LoginStatus status) override; | 36 views::View* CreateDetailedView(user::LoginStatus status) override; |
31 void DestroyTrayView() override; | 37 void DestroyTrayView() override; |
32 void DestroyDefaultView() override; | 38 void DestroyDefaultView() override; |
33 void DestroyDetailedView() override; | 39 void DestroyDetailedView() override; |
34 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; | 40 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; |
35 | 41 |
36 // Overridden from ShellObserver. | 42 // Overridden from ShellObserver. |
(...skipping 23 matching lines...) Expand all Loading... |
60 bool has_cast_receivers_ = false; | 66 bool has_cast_receivers_ = false; |
61 bool is_casting_ = false; | 67 bool is_casting_ = false; |
62 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; | 68 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; |
63 | 69 |
64 DISALLOW_COPY_AND_ASSIGN(TrayCast); | 70 DISALLOW_COPY_AND_ASSIGN(TrayCast); |
65 }; | 71 }; |
66 | 72 |
67 } // namespace ash | 73 } // namespace ash |
68 | 74 |
69 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ | 75 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ |
OLD | NEW |