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

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: Renamed and added JavaBitmap JNI registration to .h 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_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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 625
626 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( 626 void RenderWidgetHostViewAndroid::HasTouchEventHandlers(
627 bool need_touch_events) { 627 bool need_touch_events) {
628 if (content_view_core_) 628 if (content_view_core_)
629 content_view_core_->HasTouchEventHandlers(need_touch_events); 629 content_view_core_->HasTouchEventHandlers(need_touch_events);
630 } 630 }
631 631
632 // static 632 // static
633 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 633 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
634 WebKit::WebScreenInfo* results) { 634 WebKit::WebScreenInfo* results) {
635 DeviceInfo info; 635 gfx::DeviceInfo info;
636 const int width = info.GetWidth(); 636 const int width = info.GetDisplayWidth();
637 const int height = info.GetHeight(); 637 const int height = info.GetDisplayHeight();
638 results->deviceScaleFactor = info.GetDPIScale(); 638 results->deviceScaleFactor = info.GetDIPScale();
639 results->depth = info.GetBitsPerPixel(); 639 results->depth = info.GetBitsPerPixel();
640 results->depthPerComponent = info.GetBitsPerComponent(); 640 results->depthPerComponent = info.GetBitsPerComponent();
641 results->isMonochrome = (results->depthPerComponent == 0); 641 results->isMonochrome = (results->depthPerComponent == 0);
642 results->rect = WebKit::WebRect(0, 0, width, height); 642 results->rect = WebKit::WebRect(0, 0, width, height);
643 // TODO(husky): Remove any system controls from availableRect. 643 // TODO(husky): Remove any system controls from availableRect.
644 results->availableRect = WebKit::WebRect(0, 0, width, height); 644 results->availableRect = WebKit::WebRect(0, 0, width, height);
645 } 645 }
646 646
647 //////////////////////////////////////////////////////////////////////////////// 647 ////////////////////////////////////////////////////////////////////////////////
648 // RenderWidgetHostView, public: 648 // RenderWidgetHostView, public:
649 649
650 // static 650 // static
651 RenderWidgetHostView* 651 RenderWidgetHostView*
652 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 652 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
653 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 653 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
654 return new RenderWidgetHostViewAndroid(rwhi, NULL); 654 return new RenderWidgetHostViewAndroid(rwhi, NULL);
655 } 655 }
656 656
657 } // namespace content 657 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698