| 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 #include "ash/test/tray_cast_test_api.h" | 5 #include "ash/test/tray_cast_test_api.h" |
| 6 | 6 |
| 7 #include "ash/common/cast_config_delegate.h" | 7 #include "ash/common/cast_config_delegate.h" |
| 8 #include "ash/common/system/tray/system_tray.h" | 8 #include "ash/common/system/tray/system_tray.h" |
| 9 #include "ash/common/system/tray/system_tray_delegate.h" | 9 #include "ash/common/system/tray/system_tray_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void TrayCastTestAPI::StopCast() { | 43 void TrayCastTestAPI::StopCast() { |
| 44 return tray_cast_->StopCastForTest(); | 44 return tray_cast_->StopCastForTest(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { | 47 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { |
| 48 tray_cast_->OnCastingSessionStartedOrStopped(is_casting); | 48 tray_cast_->OnCastingSessionStartedOrStopped(is_casting); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void TrayCastTestAPI::ReleaseConfigCallbacks() { | 51 void TrayCastTestAPI::ReleaseConfigCallbacks() { |
| 52 tray_cast_->added_observer_ = false; | |
| 53 | |
| 54 if (WmShell::Get() && WmShell::Get()->system_tray_delegate()) { | 52 if (WmShell::Get() && WmShell::Get()->system_tray_delegate()) { |
| 55 WmShell::Get() | 53 WmShell::Get() |
| 56 ->system_tray_delegate() | 54 ->system_tray_delegate() |
| 57 ->GetCastConfigDelegate() | 55 ->GetCastConfigDelegate() |
| 58 ->RemoveObserver(tray_cast_); | 56 ->RemoveObserver(tray_cast_); |
| 59 } | 57 } |
| 60 } | 58 } |
| 61 | 59 |
| 62 bool TrayCastTestAPI::IsViewDrawn(TrayCast::ChildViewId id) const { | 60 bool TrayCastTestAPI::IsViewDrawn(TrayCast::ChildViewId id) const { |
| 63 const views::View* view = tray_cast_->GetDefaultView()->GetViewByID(id); | 61 const views::View* view = tray_cast_->GetDefaultView()->GetViewByID(id); |
| 64 return view != nullptr && view->IsDrawn(); | 62 return view != nullptr && view->IsDrawn(); |
| 65 } | 63 } |
| 66 | 64 |
| 67 } // namespace ash | 65 } // namespace ash |
| OLD | NEW |