| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/renderer_host/backing_store_skia.h" | 8 #include "content/browser/renderer_host/backing_store_skia.h" |
| 9 #include "content/browser/renderer_host/render_widget_host.h" | 9 #include "content/browser/renderer_host/render_widget_host.h" |
| 10 #include "content/browser/renderer_host/web_input_event_aura.h" | 10 #include "content/browser/renderer_host/web_input_event_aura.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 const gfx::Point& point) const { | 467 const gfx::Point& point) const { |
| 468 return HTCLIENT; | 468 return HTCLIENT; |
| 469 } | 469 } |
| 470 | 470 |
| 471 bool RenderWidgetHostViewAura::OnMouseEvent(aura::MouseEvent* event) { | 471 bool RenderWidgetHostViewAura::OnMouseEvent(aura::MouseEvent* event) { |
| 472 if (event->type() == ui::ET_MOUSEWHEEL) | 472 if (event->type() == ui::ET_MOUSEWHEEL) |
| 473 host_->ForwardWheelEvent(content::MakeWebMouseWheelEvent(event)); | 473 host_->ForwardWheelEvent(content::MakeWebMouseWheelEvent(event)); |
| 474 else if (CanRendererHandleEvent(event->native_event())) | 474 else if (CanRendererHandleEvent(event->native_event())) |
| 475 host_->ForwardMouseEvent(content::MakeWebMouseEvent(event)); | 475 host_->ForwardMouseEvent(content::MakeWebMouseEvent(event)); |
| 476 | 476 |
| 477 switch (event->type()) { |
| 478 case ui::ET_MOUSE_PRESSED: |
| 479 window_->SetCapture(); |
| 480 break; |
| 481 case ui::ET_MOUSE_RELEASED: |
| 482 window_->ReleaseCapture(); |
| 483 break; |
| 484 default: |
| 485 break; |
| 486 } |
| 487 |
| 477 // Return true so that we receive released/drag events. | 488 // Return true so that we receive released/drag events. |
| 478 return true; | 489 return true; |
| 479 } | 490 } |
| 480 | 491 |
| 481 ui::TouchStatus RenderWidgetHostViewAura::OnTouchEvent( | 492 ui::TouchStatus RenderWidgetHostViewAura::OnTouchEvent( |
| 482 aura::TouchEvent* event) { | 493 aura::TouchEvent* event) { |
| 483 // Update the touch event first. | 494 // Update the touch event first. |
| 484 WebKit::WebTouchPoint* point = content::UpdateWebTouchEvent(event, | 495 WebKit::WebTouchPoint* point = content::UpdateWebTouchEvent(event, |
| 485 &touch_event_); | 496 &touch_event_); |
| 486 | 497 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // static | 581 // static |
| 571 void RenderWidgetHostView::GetDefaultScreenInfo( | 582 void RenderWidgetHostView::GetDefaultScreenInfo( |
| 572 WebKit::WebScreenInfo* results) { | 583 WebKit::WebScreenInfo* results) { |
| 573 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 584 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); |
| 574 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 585 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
| 575 results->availableRect = results->rect; | 586 results->availableRect = results->rect; |
| 576 // TODO(derat): Don't hardcode this? | 587 // TODO(derat): Don't hardcode this? |
| 577 results->depth = 24; | 588 results->depth = 24; |
| 578 results->depthPerComponent = 8; | 589 results->depthPerComponent = 8; |
| 579 } | 590 } |
| OLD | NEW |