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

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

Issue 11886074: Use correct favicon scale factor on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final rebase after DIP scale fix. Created 7 years, 11 months 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"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "cc/layer.h" 13 #include "cc/layer.h"
14 #include "cc/texture_layer.h" 14 #include "cc/texture_layer.h"
15 #include "content/browser/android/content_view_core_impl.h" 15 #include "content/browser/android/content_view_core_impl.h"
16 #include "content/browser/gpu/gpu_surface_tracker.h" 16 #include "content/browser/gpu/gpu_surface_tracker.h"
17 #include "content/browser/renderer_host/compositor_impl_android.h" 17 #include "content/browser/renderer_host/compositor_impl_android.h"
18 #include "content/browser/renderer_host/image_transport_factory_android.h" 18 #include "content/browser/renderer_host/image_transport_factory_android.h"
19 #include "content/browser/renderer_host/render_widget_host_impl.h" 19 #include "content/browser/renderer_host/render_widget_host_impl.h"
20 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" 20 #include "content/browser/renderer_host/surface_texture_transport_client_android .h"
21 #include "content/common/android/device_info.h"
22 #include "content/common/gpu/client/gl_helper.h" 21 #include "content/common/gpu/client/gl_helper.h"
23 #include "content/common/gpu/gpu_messages.h" 22 #include "content/common/gpu/gpu_messages.h"
24 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
25 #include "third_party/khronos/GLES2/gl2.h" 24 #include "third_party/khronos/GLES2/gl2.h"
26 #include "third_party/khronos/GLES2/gl2ext.h" 25 #include "third_party/khronos/GLES2/gl2ext.h"
27 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" 26 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
28 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h" 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h"
29 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" 28 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
29 #include "ui/gfx/android/device_display_info.h"
30 #include "ui/gfx/android/java_bitmap.h" 30 #include "ui/gfx/android/java_bitmap.h"
31 #include "ui/gfx/size_conversions.h" 31 #include "ui/gfx/size_conversions.h"
32 #include "webkit/compositor_bindings/web_compositor_support_impl.h" 32 #include "webkit/compositor_bindings/web_compositor_support_impl.h"
33 33
34 namespace content { 34 namespace content {
35 35
36 namespace { 36 namespace {
37 37
38 // TODO(pliard): http://crbug.com/142585. Remove this helper function and update 38 // TODO(pliard): http://crbug.com/142585. Remove this helper function and update
39 // the clients to deal directly with WebKit::WebTextDirection. 39 // the clients to deal directly with WebKit::WebTextDirection.
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 623
624 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( 624 void RenderWidgetHostViewAndroid::HasTouchEventHandlers(
625 bool need_touch_events) { 625 bool need_touch_events) {
626 if (content_view_core_) 626 if (content_view_core_)
627 content_view_core_->HasTouchEventHandlers(need_touch_events); 627 content_view_core_->HasTouchEventHandlers(need_touch_events);
628 } 628 }
629 629
630 // static 630 // static
631 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 631 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
632 WebKit::WebScreenInfo* results) { 632 WebKit::WebScreenInfo* results) {
633 DeviceInfo info; 633 gfx::DeviceDisplayInfo info;
634 const int width = info.GetWidth(); 634 const int width = info.GetDisplayWidth();
635 const int height = info.GetHeight(); 635 const int height = info.GetDisplayHeight();
636 results->deviceScaleFactor = info.GetDPIScale(); 636 results->deviceScaleFactor = info.GetDIPScale();
637 results->depth = info.GetBitsPerPixel(); 637 results->depth = info.GetBitsPerPixel();
638 results->depthPerComponent = info.GetBitsPerComponent(); 638 results->depthPerComponent = info.GetBitsPerComponent();
639 results->isMonochrome = (results->depthPerComponent == 0); 639 results->isMonochrome = (results->depthPerComponent == 0);
640 results->rect = WebKit::WebRect(0, 0, width, height); 640 results->rect = WebKit::WebRect(0, 0, width, height);
641 // TODO(husky): Remove any system controls from availableRect. 641 // TODO(husky): Remove any system controls from availableRect.
642 results->availableRect = WebKit::WebRect(0, 0, width, height); 642 results->availableRect = WebKit::WebRect(0, 0, width, height);
643 } 643 }
644 644
645 //////////////////////////////////////////////////////////////////////////////// 645 ////////////////////////////////////////////////////////////////////////////////
646 // RenderWidgetHostView, public: 646 // RenderWidgetHostView, public:
647 647
648 // static 648 // static
649 RenderWidgetHostView* 649 RenderWidgetHostView*
650 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 650 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
651 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 651 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
652 return new RenderWidgetHostViewAndroid(rwhi, NULL); 652 return new RenderWidgetHostViewAndroid(rwhi, NULL);
653 } 653 }
654 654
655 } // namespace content 655 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/common/android/common_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698