OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 556 } |
557 | 557 |
558 // static | 558 // static |
559 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 559 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
560 WebKit::WebScreenInfo* results) { | 560 WebKit::WebScreenInfo* results) { |
561 DeviceInfo info; | 561 DeviceInfo info; |
562 const int width = info.GetWidth(); | 562 const int width = info.GetWidth(); |
563 const int height = info.GetHeight(); | 563 const int height = info.GetHeight(); |
564 results->horizontalDPI = 160 * info.GetDPIScale(); | 564 results->horizontalDPI = 160 * info.GetDPIScale(); |
565 results->verticalDPI = 160 * info.GetDPIScale(); | 565 results->verticalDPI = 160 * info.GetDPIScale(); |
| 566 results->deviceScaleFactor = info.GetDPIScale(); |
566 results->depth = info.GetBitsPerPixel(); | 567 results->depth = info.GetBitsPerPixel(); |
567 results->depthPerComponent = info.GetBitsPerComponent(); | 568 results->depthPerComponent = info.GetBitsPerComponent(); |
568 results->isMonochrome = (results->depthPerComponent == 0); | 569 results->isMonochrome = (results->depthPerComponent == 0); |
569 results->rect = WebKit::WebRect(0, 0, width, height); | 570 results->rect = WebKit::WebRect(0, 0, width, height); |
570 // TODO(husky): Remove any system controls from availableRect. | 571 // TODO(husky): Remove any system controls from availableRect. |
571 results->availableRect = WebKit::WebRect(0, 0, width, height); | 572 results->availableRect = WebKit::WebRect(0, 0, width, height); |
572 } | 573 } |
573 | 574 |
574 //////////////////////////////////////////////////////////////////////////////// | 575 //////////////////////////////////////////////////////////////////////////////// |
575 // RenderWidgetHostView, public: | 576 // RenderWidgetHostView, public: |
576 | 577 |
577 // static | 578 // static |
578 RenderWidgetHostView* | 579 RenderWidgetHostView* |
579 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 580 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
580 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 581 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
581 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 582 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
582 } | 583 } |
583 | 584 |
584 } // namespace content | 585 } // namespace content |
OLD | NEW |