Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 ack_pending_count_(0), | 41 ack_pending_count_(0), |
| 42 frame_connector_(nullptr), | 42 frame_connector_(nullptr), |
| 43 weak_factory_(this) { | 43 weak_factory_(this) { |
| 44 if (use_surfaces_) { | 44 if (use_surfaces_) { |
| 45 id_allocator_ = CreateSurfaceIdAllocator(); | 45 id_allocator_ = CreateSurfaceIdAllocator(); |
| 46 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { | 46 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { |
| 47 host_->delegate()->GetInputEventRouter()->AddSurfaceIdNamespaceOwner( | 47 host_->delegate()->GetInputEventRouter()->AddSurfaceIdNamespaceOwner( |
| 48 GetSurfaceIdNamespace(), this); | 48 GetSurfaceIdNamespace(), this); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 // Input for child frames are already scaled. |
| 52 // TODO(oshima): This should be true for OOPIF. | |
| 53 host_->set_scale_input_to_viewport(false); | |
|
wjmaclean
2016/01/20 19:41:54
If it should be true for OOPIF, can't we just do
oshima
2016/01/20 21:38:49
I looked into more, and I think we can just move t
| |
| 52 host_->SetView(this); | 54 host_->SetView(this); |
| 53 } | 55 } |
| 54 | 56 |
| 55 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { | 57 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { |
| 56 if (!surface_id_.is_null()) | 58 if (!surface_id_.is_null()) |
| 57 surface_factory_->Destroy(surface_id_); | 59 surface_factory_->Destroy(surface_id_); |
| 58 } | 60 } |
| 59 | 61 |
| 60 void RenderWidgetHostViewChildFrame::InitAsChild( | 62 void RenderWidgetHostViewChildFrame::InitAsChild( |
| 61 gfx::NativeView parent_view) { | 63 gfx::NativeView parent_view) { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 #endif | 499 #endif |
| 498 } | 500 } |
| 499 | 501 |
| 500 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { | 502 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { |
| 501 if (surface_factory_ && !surface_id_.is_null()) | 503 if (surface_factory_ && !surface_id_.is_null()) |
| 502 surface_factory_->Destroy(surface_id_); | 504 surface_factory_->Destroy(surface_id_); |
| 503 surface_id_ = cc::SurfaceId(); | 505 surface_id_ = cc::SurfaceId(); |
| 504 } | 506 } |
| 505 | 507 |
| 506 } // namespace content | 508 } // namespace content |
| OLD | NEW |