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

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 TrayCastTestMethods {
achuithb 2015/07/14 18:06:39 TrayCastTestingInterface? Does it compile if you
jdufault 2015/07/15 17:35:01 Done. I am unable to get it to compile moving it
achuithb 2015/07/15 18:56:47 That's what I would expect if the compiler refuses
jdufault 2015/07/15 20:08:42 Yes; I would have been surprised if it worked as w
23 public:
24 virtual bool IsTrayInitializedForTest() const = 0;
25 virtual bool IsTrayVisibleForTest() const = 0;
26 virtual bool IsTrayCastViewVisibleForTest() const = 0;
achuithb 2015/07/14 18:06:39 Maybe add a comment explaining the different betwe
jdufault 2015/07/15 17:35:01 Done.
achuithb 2015/07/15 18:56:47 I meant the difference between IsTrayCastViewVisib
jdufault 2015/07/15 20:08:42 Oops; done.
27 virtual bool IsTraySelectViewVisibleForTest() const = 0;
28 // Start a new cast to the given receiver.
29 virtual void StartCastForTest(const std::string& id) = 0;
30 virtual void StopCastForTest() = 0;
31
32 // Exposed callback to update the casting state. The test code needs to call
33 // this function manually, as there is no actual casting going on. In a real
34 // environment, this method is invoked by the casting system in Chrome.
35 virtual void OnCastingSessionStartedOrStopped(bool is_casting) = 0;
36 };
37
38 class ASH_EXPORT TrayCast : public SystemTrayItem,
39 public ShellObserver,
40 public TrayCastTestMethods {
22 public: 41 public:
23 explicit TrayCast(SystemTray* system_tray); 42 explicit TrayCast(SystemTray* system_tray);
24 ~TrayCast() override; 43 ~TrayCast() override;
25 44
26 private: 45 private:
46 // Overridden from TrayCastTestMethods:
achuithb 2015/07/14 18:06:39 use a period to be consistent with the rest of thi
jdufault 2015/07/15 17:35:01 Done.
47 bool IsTrayInitializedForTest() const override;
48 bool IsTrayVisibleForTest() const override;
49 bool IsTrayCastViewVisibleForTest() const override;
50 bool IsTraySelectViewVisibleForTest() const override;
51 void StartCastForTest(const std::string& id) override;
52 void StopCastForTest() override;
53
27 // Overridden from SystemTrayItem. 54 // Overridden from SystemTrayItem.
28 views::View* CreateTrayView(user::LoginStatus status) override; 55 views::View* CreateTrayView(user::LoginStatus status) override;
29 views::View* CreateDefaultView(user::LoginStatus status) override; 56 views::View* CreateDefaultView(user::LoginStatus status) override;
30 views::View* CreateDetailedView(user::LoginStatus status) override; 57 views::View* CreateDetailedView(user::LoginStatus status) override;
31 void DestroyTrayView() override; 58 void DestroyTrayView() override;
32 void DestroyDefaultView() override; 59 void DestroyDefaultView() override;
33 void DestroyDetailedView() override; 60 void DestroyDetailedView() override;
34 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; 61 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
35 62
36 // Overridden from ShellObserver. 63 // Overridden from ShellObserver.
(...skipping 23 matching lines...) Expand all
60 bool has_cast_receivers_ = false; 87 bool has_cast_receivers_ = false;
61 bool is_casting_ = false; 88 bool is_casting_ = false;
62 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; 89 base::WeakPtrFactory<TrayCast> weak_ptr_factory_;
63 90
64 DISALLOW_COPY_AND_ASSIGN(TrayCast); 91 DISALLOW_COPY_AND_ASSIGN(TrayCast);
65 }; 92 };
66 93
67 } // namespace ash 94 } // namespace ash
68 95
69 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ 96 #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