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 "ui/views/view.h" |
| 8 |
| 9 namespace ash { |
| 10 |
| 11 TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) { |
| 12 } |
| 13 |
| 14 TrayCastTestAPI::~TrayCastTestAPI() { |
| 15 } |
| 16 |
| 17 bool TrayCastTestAPI::IsTrayInitialized() const { |
| 18 return tray_cast_->default_ != nullptr; |
| 19 } |
| 20 |
| 21 bool TrayCastTestAPI::IsTrayVisible() const { |
| 22 views::View* tray_view = |
| 23 tray_cast_->FindChildViewForTest(TrayCast::TRAY_VIEW); |
| 24 return tray_view != nullptr && tray_view->IsDrawn(); |
| 25 } |
| 26 |
| 27 bool TrayCastTestAPI::IsTrayCastViewVisible() const { |
| 28 return tray_cast_->FindChildViewForTest(TrayCast::CAST_VIEW)->IsDrawn(); |
| 29 } |
| 30 |
| 31 bool TrayCastTestAPI::IsTraySelectViewVisible() const { |
| 32 return tray_cast_->FindChildViewForTest(TrayCast::SELECT_VIEW)->IsDrawn(); |
| 33 } |
| 34 |
| 35 void TrayCastTestAPI::StartCast(const std::string& receiver_id) { |
| 36 return tray_cast_->StartCastForTest(receiver_id); |
| 37 } |
| 38 |
| 39 void TrayCastTestAPI::StopCast() { |
| 40 return tray_cast_->StopCastForTest(); |
| 41 } |
| 42 |
| 43 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { |
| 44 tray_cast_->OnCastingSessionStartedOrStopped(is_casting); |
| 45 } |
| 46 |
| 47 } // namespace ash |
OLD | NEW |