| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 "ppapi/cpp/private/view_private.h" |
| 6 |
| 7 #include "ppapi/c/private/ppb_view_private.h" |
| 8 #include "ppapi/cpp/module_impl.h" |
| 9 |
| 10 namespace pp { |
| 11 |
| 12 namespace { |
| 13 |
| 14 template <> const char* interface_name<PPB_View_Private>() { |
| 15 return PPB_VIEW_PRIVATE_INTERFACE; |
| 16 } |
| 17 |
| 18 } // namespace |
| 19 |
| 20 float ViewPrivate::GetDeviceScale() const { |
| 21 if (has_interface<PPB_View_Private>()) { |
| 22 float out; |
| 23 if (PP_ToBool(get_interface<PPB_View_Private>()->GetDeviceScale( |
| 24 pp_resource(), &out))) |
| 25 return out; |
| 26 } |
| 27 return 1.0f; |
| 28 } |
| 29 |
| 30 float ViewPrivate::GetCSSScale() const { |
| 31 if (has_interface<PPB_View_Private>()) { |
| 32 float out; |
| 33 if (PP_ToBool(get_interface<PPB_View_Private>()->GetCSSScale( |
| 34 pp_resource(), &out))) |
| 35 return out; |
| 36 } |
| 37 return 1.0f; |
| 38 } |
| 39 |
| 40 } // namespace pp |
| OLD | NEW |