Implement GetScreenInfo
This commit is contained in:
parent
39ddeff5c3
commit
d71f10c5a3
2 changed files with 12 additions and 0 deletions
|
@ -207,6 +207,8 @@ class OffScreenRenderWidgetHostView
|
||||||
content::RenderWidgetHostImpl* render_widget_host() const
|
content::RenderWidgetHostImpl* render_widget_host() const
|
||||||
{ return render_widget_host_; }
|
{ return render_widget_host_; }
|
||||||
NativeWindow* window() const { return native_window_; }
|
NativeWindow* window() const { return native_window_; }
|
||||||
|
gfx::Size size() const { return size_; }
|
||||||
|
float scale_factor() const { return scale_factor_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupFrameRate(bool force);
|
void SetupFrameRate(bool force);
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "atom/browser/osr/osr_web_contents_view.h"
|
#include "atom/browser/osr/osr_web_contents_view.h"
|
||||||
|
|
||||||
|
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
OffScreenWebContentsView::OffScreenWebContentsView(
|
OffScreenWebContentsView::OffScreenWebContentsView(
|
||||||
|
@ -108,6 +110,14 @@ void OffScreenWebContentsView::SetOverscrollControllerEnabled(bool enabled) {
|
||||||
|
|
||||||
void OffScreenWebContentsView::GetScreenInfo(
|
void OffScreenWebContentsView::GetScreenInfo(
|
||||||
blink::WebScreenInfo* web_screen_info) const {
|
blink::WebScreenInfo* web_screen_info) const {
|
||||||
|
web_screen_info->rect = gfx::Rect(view_->size());
|
||||||
|
web_screen_info->availableRect = gfx::Rect(view_->size());
|
||||||
|
web_screen_info->depth = 24;
|
||||||
|
web_screen_info->depthPerComponent = 8;
|
||||||
|
web_screen_info->deviceScaleFactor = view_->scale_factor();
|
||||||
|
web_screen_info->orientationAngle = 0;
|
||||||
|
web_screen_info->orientationType =
|
||||||
|
blink::WebScreenOrientationLandscapePrimary;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue