OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 void RenderWidgetHostViewChildFrame::ProcessAckedTouchEvent( | 470 void RenderWidgetHostViewChildFrame::ProcessAckedTouchEvent( |
471 const TouchEventWithLatencyInfo& touch, | 471 const TouchEventWithLatencyInfo& touch, |
472 InputEventAckState ack_result) { | 472 InputEventAckState ack_result) { |
473 if (!frame_connector_) | 473 if (!frame_connector_) |
474 return; | 474 return; |
475 | 475 |
476 frame_connector_->ForwardProcessAckedTouchEvent(touch, ack_result); | 476 frame_connector_->ForwardProcessAckedTouchEvent(touch, ack_result); |
477 } | 477 } |
478 | 478 |
479 bool RenderWidgetHostViewChildFrame::LockMouse() { | 479 bool RenderWidgetHostViewChildFrame::LockMouse() { |
480 if (frame_connector_) | |
481 return frame_connector_->LockMouse(); | |
480 return false; | 482 return false; |
481 } | 483 } |
482 | 484 |
483 void RenderWidgetHostViewChildFrame::UnlockMouse() { | 485 void RenderWidgetHostViewChildFrame::UnlockMouse() { |
484 } | 486 } |
485 | 487 |
488 bool RenderWidgetHostViewChildFrame::IsMouseLocked() { | |
489 if (frame_connector_) { | |
nasko
2016/05/25 21:12:01
Why not early return false if !frame_connector_? I
lfg
2016/05/31 21:13:20
In this case I need two 'return false' since the r
| |
490 RenderWidgetHostViewBase* root_view = | |
491 frame_connector_->GetRootRenderWidgetHostView(); | |
492 | |
493 if (root_view) | |
494 return root_view->IsMouseLocked(); | |
495 } | |
496 | |
497 return false; | |
498 } | |
499 | |
486 uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() { | 500 uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() { |
487 return id_allocator_->id_namespace(); | 501 return id_allocator_->id_namespace(); |
488 } | 502 } |
489 | 503 |
490 void RenderWidgetHostViewChildFrame::ProcessKeyboardEvent( | 504 void RenderWidgetHostViewChildFrame::ProcessKeyboardEvent( |
491 const NativeWebKeyboardEvent& event) { | 505 const NativeWebKeyboardEvent& event) { |
492 host_->ForwardKeyboardEvent(event); | 506 host_->ForwardKeyboardEvent(event); |
493 } | 507 } |
494 | 508 |
495 void RenderWidgetHostViewChildFrame::ProcessMouseEvent( | 509 void RenderWidgetHostViewChildFrame::ProcessMouseEvent( |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 | 699 |
686 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 700 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
687 return true; | 701 return true; |
688 } | 702 } |
689 | 703 |
690 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 704 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
691 return surface_id_; | 705 return surface_id_; |
692 }; | 706 }; |
693 | 707 |
694 } // namespace content | 708 } // namespace content |
OLD | NEW |