Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 11348033: Initialize device scale factor correctly on Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't truncate scale factor on Chrome OS. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 } 557 }
558 558
559 // static 559 // static
560 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 560 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
561 WebKit::WebScreenInfo* results) { 561 WebKit::WebScreenInfo* results) {
562 DeviceInfo info; 562 DeviceInfo info;
563 const int width = info.GetWidth(); 563 const int width = info.GetWidth();
564 const int height = info.GetHeight(); 564 const int height = info.GetHeight();
565 results->horizontalDPI = 160 * info.GetDPIScale(); 565 results->horizontalDPI = 160 * info.GetDPIScale();
566 results->verticalDPI = 160 * info.GetDPIScale(); 566 results->verticalDPI = 160 * info.GetDPIScale();
567 results->deviceScaleFactor = info.GetDPIScale();
567 results->depth = info.GetBitsPerPixel(); 568 results->depth = info.GetBitsPerPixel();
568 results->depthPerComponent = info.GetBitsPerComponent(); 569 results->depthPerComponent = info.GetBitsPerComponent();
569 results->isMonochrome = (results->depthPerComponent == 0); 570 results->isMonochrome = (results->depthPerComponent == 0);
570 results->rect = WebKit::WebRect(0, 0, width, height); 571 results->rect = WebKit::WebRect(0, 0, width, height);
571 // TODO(husky): Remove any system controls from availableRect. 572 // TODO(husky): Remove any system controls from availableRect.
572 results->availableRect = WebKit::WebRect(0, 0, width, height); 573 results->availableRect = WebKit::WebRect(0, 0, width, height);
573 } 574 }
574 575
575 //////////////////////////////////////////////////////////////////////////////// 576 ////////////////////////////////////////////////////////////////////////////////
576 // RenderWidgetHostView, public: 577 // RenderWidgetHostView, public:
577 578
578 // static 579 // static
579 RenderWidgetHostView* 580 RenderWidgetHostView*
580 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 581 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
581 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 582 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
582 return new RenderWidgetHostViewAndroid(rwhi, NULL); 583 return new RenderWidgetHostViewAndroid(rwhi, NULL);
583 } 584 }
584 585
585 } // namespace content 586 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | ui/gfx/display.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698