| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 | 377 |
| 378 void RenderWidgetHostViewAndroid::UnhandledWheelEvent( | 378 void RenderWidgetHostViewAndroid::UnhandledWheelEvent( |
| 379 const WebKit::WebMouseWheelEvent& event) { | 379 const WebKit::WebMouseWheelEvent& event) { |
| 380 // intentionally empty, like RenderWidgetHostViewViews | 380 // intentionally empty, like RenderWidgetHostViewViews |
| 381 } | 381 } |
| 382 | 382 |
| 383 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( | 383 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( |
| 384 const WebKit::WebTouchEvent& touch_event, | 384 const WebKit::WebTouchEvent& touch_event, |
| 385 bool processed) { | 385 bool processed) { |
| 386 // intentionally empty, like RenderWidgetHostViewViews | 386 if (content_view_core_) |
| 387 content_view_core_->ConfirmTouchEvent(processed); |
| 387 } | 388 } |
| 388 | 389 |
| 389 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( | 390 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( |
| 390 bool has_horizontal_scrollbar) { | 391 bool has_horizontal_scrollbar) { |
| 391 // intentionally empty, like RenderWidgetHostViewViews | 392 // intentionally empty, like RenderWidgetHostViewViews |
| 392 } | 393 } |
| 393 | 394 |
| 394 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( | 395 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( |
| 395 bool is_pinned_to_left, bool is_pinned_to_right) { | 396 bool is_pinned_to_left, bool is_pinned_to_right) { |
| 396 // intentionally empty, like RenderWidgetHostViewViews | 397 // intentionally empty, like RenderWidgetHostViewViews |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 void RenderWidgetHostViewAndroid::SetContentViewCore( | 477 void RenderWidgetHostViewAndroid::SetContentViewCore( |
| 477 ContentViewCoreImpl* content_view_core) { | 478 ContentViewCoreImpl* content_view_core) { |
| 478 content_view_core_ = content_view_core; | 479 content_view_core_ = content_view_core; |
| 479 if (host_) { | 480 if (host_) { |
| 480 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 481 GpuSurfaceTracker::Get()->SetSurfaceHandle( |
| 481 host_->surface_id(), content_view_core_ ? | 482 host_->surface_id(), content_view_core_ ? |
| 482 GetCompositingSurface() : gfx::GLSurfaceHandle()); | 483 GetCompositingSurface() : gfx::GLSurfaceHandle()); |
| 483 } | 484 } |
| 484 } | 485 } |
| 485 | 486 |
| 486 void RenderWidgetHostViewAndroid::DidSetNeedTouchEvents( | 487 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( |
| 487 bool need_touch_events) { | 488 bool need_touch_events) { |
| 488 if (content_view_core_) | 489 if (content_view_core_) |
| 489 content_view_core_->DidSetNeedTouchEvents(need_touch_events); | 490 content_view_core_->HasTouchEventHandlers(need_touch_events); |
| 490 } | 491 } |
| 491 | 492 |
| 492 // static | 493 // static |
| 493 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 494 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 494 WebKit::WebScreenInfo* results) { | 495 WebKit::WebScreenInfo* results) { |
| 495 DeviceInfo info; | 496 DeviceInfo info; |
| 496 const int width = info.GetWidth(); | 497 const int width = info.GetWidth(); |
| 497 const int height = info.GetHeight(); | 498 const int height = info.GetHeight(); |
| 498 results->horizontalDPI = 160 * info.GetDPIScale(); | 499 results->horizontalDPI = 160 * info.GetDPIScale(); |
| 499 results->verticalDPI = 160 * info.GetDPIScale(); | 500 results->verticalDPI = 160 * info.GetDPIScale(); |
| 500 results->depth = info.GetBitsPerPixel(); | 501 results->depth = info.GetBitsPerPixel(); |
| 501 results->depthPerComponent = info.GetBitsPerComponent(); | 502 results->depthPerComponent = info.GetBitsPerComponent(); |
| 502 results->isMonochrome = (results->depthPerComponent == 0); | 503 results->isMonochrome = (results->depthPerComponent == 0); |
| 503 results->rect = WebKit::WebRect(0, 0, width, height); | 504 results->rect = WebKit::WebRect(0, 0, width, height); |
| 504 // TODO(husky): Remove any system controls from availableRect. | 505 // TODO(husky): Remove any system controls from availableRect. |
| 505 results->availableRect = WebKit::WebRect(0, 0, width, height); | 506 results->availableRect = WebKit::WebRect(0, 0, width, height); |
| 506 } | 507 } |
| 507 | 508 |
| 508 //////////////////////////////////////////////////////////////////////////////// | 509 //////////////////////////////////////////////////////////////////////////////// |
| 509 // RenderWidgetHostView, public: | 510 // RenderWidgetHostView, public: |
| 510 | 511 |
| 511 // static | 512 // static |
| 512 RenderWidgetHostView* | 513 RenderWidgetHostView* |
| 513 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 514 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 514 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 515 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 515 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 516 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 516 } | 517 } |
| 517 | 518 |
| 518 } // namespace content | 519 } // namespace content |
| OLD | NEW |