Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: ash/system/cast/tray_cast.h

Issue 1218653006: Add support code to test the cast system tray item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/cast/tray_cast.cc » ('j') | ash/system/cast/tray_cast.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ash_export.h"
8 #include "ash/cast_config_delegate.h" 9 #include "ash/cast_config_delegate.h"
9 #include "ash/shell_observer.h" 10 #include "ash/shell_observer.h"
10 #include "ash/system/tray/system_tray_item.h" 11 #include "ash/system/tray/system_tray_item.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 13
13 namespace ash { 14 namespace ash {
14 namespace tray { 15 namespace tray {
15 class CastTrayView; 16 class CastTrayView;
16 class CastSelectDefaultView; 17 class CastSelectDefaultView;
17 class CastDetailedView; 18 class CastDetailedView;
18 class CastDuplexView; 19 class CastDuplexView;
19 } // namespace tray 20 } // namespace tray
20 21
21 class TrayCast : public SystemTrayItem, public ShellObserver { 22 class ASH_EXPORT TrayCast : public SystemTrayItem, public ShellObserver {
22 public: 23 public:
23 explicit TrayCast(SystemTray* system_tray); 24 explicit TrayCast(SystemTray* system_tray);
24 ~TrayCast() override; 25 ~TrayCast() override;
25 26
27 // The following are functions used for testing. It would be great if they
achuithb 2015/07/08 21:45:57 Have you looked at FRIEND_TEST_ALL_PREFIXES?
jdufault 2015/07/09 23:11:28 Doesn't seem to work, since the test and this clas
28 // were private, but they are used in browsertests, which are implemented as
29 // derived classes, which means we cannot use friendship.
30 bool IsTrayInitializedForTest();
achuithb 2015/07/08 21:45:57 const
jdufault 2015/07/09 23:11:28 Done.
31 bool IsTrayVisibleForTest();
achuithb 2015/07/08 21:45:57 const
jdufault 2015/07/09 23:11:28 Done.
32 // Start a new cast to the given receiver.
33 void StartCastForTest(std::string id);
achuithb 2015/07/08 21:45:57 const std::string& receiver_id
jdufault 2015/07/09 23:11:28 Done.
34 void StopCastForTest();
35
26 private: 36 private:
27 // Overridden from SystemTrayItem. 37 // Overridden from SystemTrayItem.
28 views::View* CreateTrayView(user::LoginStatus status) override; 38 views::View* CreateTrayView(user::LoginStatus status) override;
29 views::View* CreateDefaultView(user::LoginStatus status) override; 39 views::View* CreateDefaultView(user::LoginStatus status) override;
30 views::View* CreateDetailedView(user::LoginStatus status) override; 40 views::View* CreateDetailedView(user::LoginStatus status) override;
31 void DestroyTrayView() override; 41 void DestroyTrayView() override;
32 void DestroyDefaultView() override; 42 void DestroyDefaultView() override;
33 void DestroyDetailedView() override; 43 void DestroyDetailedView() override;
34 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; 44 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
35 45
(...skipping 24 matching lines...) Expand all
60 bool has_cast_receivers_ = false; 70 bool has_cast_receivers_ = false;
61 bool is_casting_ = false; 71 bool is_casting_ = false;
62 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; 72 base::WeakPtrFactory<TrayCast> weak_ptr_factory_;
63 73
64 DISALLOW_COPY_AND_ASSIGN(TrayCast); 74 DISALLOW_COPY_AND_ASSIGN(TrayCast);
65 }; 75 };
66 76
67 } // namespace ash 77 } // namespace ash
68 78
69 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ 79 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_
OLDNEW
« no previous file with comments | « no previous file | ash/system/cast/tray_cast.cc » ('j') | ash/system/cast/tray_cast.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698