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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 // as we are returning the WebView and not root window bounds. | 373 // as we are returning the WebView and not root window bounds. |
374 gfx::Rect RenderWidgetHostViewAndroid::GetBoundsInRootWindow() { | 374 gfx::Rect RenderWidgetHostViewAndroid::GetBoundsInRootWindow() { |
375 return GetViewBounds(); | 375 return GetViewBounds(); |
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::ProcessTouchAck(bool processed) { | 383 void RenderWidgetHostViewAndroid::ProcessTouchAck(bool processed) { |
sadrul
2012/10/18 01:42:27
This has changed in trunk to ProcessAckedTouchEven
Yaron
2012/10/18 02:03:22
Ya, Android might still need to be further updated
| |
384 // intentionally empty, like RenderWidgetHostViewViews | 384 if (content_view_core_) |
385 content_view_core_->ConfirmTouchEvent(processed); | |
385 } | 386 } |
386 | 387 |
387 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( | 388 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( |
388 bool has_horizontal_scrollbar) { | 389 bool has_horizontal_scrollbar) { |
389 // intentionally empty, like RenderWidgetHostViewViews | 390 // intentionally empty, like RenderWidgetHostViewViews |
390 } | 391 } |
391 | 392 |
392 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( | 393 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( |
393 bool is_pinned_to_left, bool is_pinned_to_right) { | 394 bool is_pinned_to_left, bool is_pinned_to_right) { |
394 // intentionally empty, like RenderWidgetHostViewViews | 395 // intentionally empty, like RenderWidgetHostViewViews |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 void RenderWidgetHostViewAndroid::SetContentViewCore( | 475 void RenderWidgetHostViewAndroid::SetContentViewCore( |
475 ContentViewCoreImpl* content_view_core) { | 476 ContentViewCoreImpl* content_view_core) { |
476 content_view_core_ = content_view_core; | 477 content_view_core_ = content_view_core; |
477 if (host_) { | 478 if (host_) { |
478 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 479 GpuSurfaceTracker::Get()->SetSurfaceHandle( |
479 host_->surface_id(), content_view_core_ ? | 480 host_->surface_id(), content_view_core_ ? |
480 GetCompositingSurface() : gfx::GLSurfaceHandle()); | 481 GetCompositingSurface() : gfx::GLSurfaceHandle()); |
481 } | 482 } |
482 } | 483 } |
483 | 484 |
484 void RenderWidgetHostViewAndroid::DidSetNeedTouchEvents( | 485 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( |
485 bool need_touch_events) { | 486 bool need_touch_events) { |
486 if (content_view_core_) | 487 if (content_view_core_) |
487 content_view_core_->DidSetNeedTouchEvents(need_touch_events); | 488 content_view_core_->HasTouchEventHandlers(need_touch_events); |
489 | |
Jay Civelli
2012/10/18 01:33:34
Nit: remove blank line.
| |
488 } | 490 } |
489 | 491 |
490 // static | 492 // static |
491 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 493 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
492 WebKit::WebScreenInfo* results) { | 494 WebKit::WebScreenInfo* results) { |
493 DeviceInfo info; | 495 DeviceInfo info; |
494 const int width = info.GetWidth(); | 496 const int width = info.GetWidth(); |
495 const int height = info.GetHeight(); | 497 const int height = info.GetHeight(); |
496 results->horizontalDPI = 160 * info.GetDPIScale(); | 498 results->horizontalDPI = 160 * info.GetDPIScale(); |
497 results->verticalDPI = 160 * info.GetDPIScale(); | 499 results->verticalDPI = 160 * info.GetDPIScale(); |
498 results->depth = info.GetBitsPerPixel(); | 500 results->depth = info.GetBitsPerPixel(); |
499 results->depthPerComponent = info.GetBitsPerComponent(); | 501 results->depthPerComponent = info.GetBitsPerComponent(); |
500 results->isMonochrome = (results->depthPerComponent == 0); | 502 results->isMonochrome = (results->depthPerComponent == 0); |
501 results->rect = WebKit::WebRect(0, 0, width, height); | 503 results->rect = WebKit::WebRect(0, 0, width, height); |
502 // TODO(husky): Remove any system controls from availableRect. | 504 // TODO(husky): Remove any system controls from availableRect. |
503 results->availableRect = WebKit::WebRect(0, 0, width, height); | 505 results->availableRect = WebKit::WebRect(0, 0, width, height); |
504 } | 506 } |
505 | 507 |
506 //////////////////////////////////////////////////////////////////////////////// | 508 //////////////////////////////////////////////////////////////////////////////// |
507 // RenderWidgetHostView, public: | 509 // RenderWidgetHostView, public: |
508 | 510 |
509 // static | 511 // static |
510 RenderWidgetHostView* | 512 RenderWidgetHostView* |
511 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 513 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
512 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 514 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
513 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 515 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
514 } | 516 } |
515 | 517 |
516 } // namespace content | 518 } // namespace content |
OLD | NEW |