Chromium Code Reviews| 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 #include "ash/test/tray_cast_test_api.h" | |
| 6 | |
| 7 #include "ash/system/tray/system_tray.h" | |
| 8 #include "ui/views/view.h" | |
| 9 | |
| 10 namespace ash { | |
| 11 | |
| 12 TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) { | |
| 13 } | |
| 14 | |
| 15 TrayCastTestAPI::~TrayCastTestAPI() { | |
| 16 } | |
| 17 | |
| 18 bool TrayCastTestAPI::IsTrayInitialized() const { | |
| 19 return tray_cast_->default_ != nullptr; | |
| 20 } | |
| 21 | |
| 22 bool TrayCastTestAPI::IsTrayVisible() const { | |
|
achuithb
2015/07/21 19:52:29
Create a helper like:
bool IsTrayViewVisible(Chil
jdufault
2015/07/21 20:21:31
Done.
| |
| 23 const views::View* view = | |
| 24 tray_cast_->default_view()->GetViewByID(TrayCast::TRAY_VIEW); | |
| 25 return view != nullptr && view->IsDrawn(); | |
| 26 } | |
| 27 | |
| 28 bool TrayCastTestAPI::IsTrayCastViewVisible() const { | |
| 29 views::View* view = | |
|
achuithb
2015/07/21 19:52:29
const
jdufault
2015/07/21 20:21:31
Done.
| |
| 30 tray_cast_->default_view()->GetViewByID(TrayCast::CAST_VIEW); | |
| 31 return view != nullptr && view->IsDrawn(); | |
| 32 } | |
| 33 | |
| 34 bool TrayCastTestAPI::IsTraySelectViewVisible() const { | |
| 35 views::View* view = | |
|
achuithb
2015/07/21 19:52:29
const
jdufault
2015/07/21 20:21:31
Done.
| |
| 36 tray_cast_->default_view()->GetViewByID(TrayCast::SELECT_VIEW); | |
| 37 return view != nullptr && view->IsDrawn(); | |
| 38 } | |
| 39 | |
| 40 void TrayCastTestAPI::StartCast(const std::string& receiver_id) { | |
| 41 return tray_cast_->StartCastForTest(receiver_id); | |
| 42 } | |
| 43 | |
| 44 void TrayCastTestAPI::StopCast() { | |
| 45 return tray_cast_->StopCastForTest(); | |
| 46 } | |
| 47 | |
| 48 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { | |
| 49 tray_cast_->OnCastingSessionStartedOrStopped(is_casting); | |
| 50 } | |
| 51 | |
| 52 } // namespace ash | |
| OLD | NEW |