| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/base/resource/scale_factor.h" | 5 #include "media/remoting/remoting_sink_observer.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 namespace media { |
| 8 | 8 |
| 9 namespace ui { | 9 RemotingSinkObserver::RemotingSinkObserver( |
| 10 mojom::RemotingSourceRequest source_request, |
| 11 mojom::RemoterPtr remoter) |
| 12 : binding_(this, std::move(source_request)), remoter_(std::move(remoter)) {} |
| 10 | 13 |
| 11 namespace { | 14 RemotingSinkObserver::~RemotingSinkObserver() {} |
| 12 | 15 |
| 13 const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f, | 16 void RemotingSinkObserver::OnSinkAvailable() { |
| 14 2.0f, 2.5f, 3.0f}; | 17 is_sink_available_ = true; |
| 15 static_assert(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), | |
| 16 "kScaleFactorScales has incorrect size"); | |
| 17 | |
| 18 } // namespace | |
| 19 | |
| 20 float GetScaleForScaleFactor(ScaleFactor scale_factor) { | |
| 21 return kScaleFactorScales[scale_factor]; | |
| 22 } | 18 } |
| 23 | 19 |
| 24 } // namespace ui | 20 void RemotingSinkObserver::OnSinkGone() { |
| 21 is_sink_available_ = false; |
| 22 } |
| 23 |
| 24 } // namespace media |
| OLD | NEW |