1 // Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_BROWSER_VIEWS_DISPLAY_IMPL_H_ 6 #define CEF_LIBCEF_BROWSER_VIEWS_DISPLAY_IMPL_H_ 7 #pragma once 8 9 #include "include/views/cef_display.h" 10 #include "libcef/browser/thread_util.h" 11 12 #include "ui/display/display.h" 13 14 class CefDisplayImpl : public CefDisplay { 15 public: 16 explicit CefDisplayImpl(const display::Display& display); 17 18 CefDisplayImpl(const CefDisplayImpl&) = delete; 19 CefDisplayImpl& operator=(const CefDisplayImpl&) = delete; 20 21 ~CefDisplayImpl() override; 22 23 // CefDisplay methods: 24 int64 GetID() override; 25 float GetDeviceScaleFactor() override; 26 void ConvertPointToPixels(CefPoint& point) override; 27 void ConvertPointFromPixels(CefPoint& point) override; 28 CefRect GetBounds() override; 29 CefRect GetWorkArea() override; 30 int GetRotation() override; 31 display()32 const display::Display& display() const { return display_; } 33 34 private: 35 display::Display display_; 36 37 IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDisplayImpl); 38 }; 39 40 #endif // CEF_LIBCEF_BROWSER_VIEWS_DISPLAY_IMPL_H_ 41