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 <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 observing_root_window_(false), | 440 observing_root_window_(false), |
441 prev_top_shown_pix_(0.f), | 441 prev_top_shown_pix_(0.f), |
442 prev_bottom_shown_pix_(0.f), | 442 prev_bottom_shown_pix_(0.f), |
443 weak_ptr_factory_(this) { | 443 weak_ptr_factory_(this) { |
444 // Set the layer which will hold the content layer for this view. The content | 444 // Set the layer which will hold the content layer for this view. The content |
445 // layer is managed by the DelegatedFrameHost. | 445 // layer is managed by the DelegatedFrameHost. |
446 view_.SetLayer(cc::Layer::Create()); | 446 view_.SetLayer(cc::Layer::Create()); |
447 if (using_browser_compositor_) { | 447 if (using_browser_compositor_) { |
448 cc::FrameSinkId frame_sink_id = | 448 cc::FrameSinkId frame_sink_id = |
449 host_->AllocateFrameSinkId(false /* is_guest_view_hack */); | 449 host_->AllocateFrameSinkId(false /* is_guest_view_hack */); |
450 delegated_frame_host_.reset( | 450 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( |
451 new ui::DelegatedFrameHostAndroid(&view_, this, frame_sink_id)); | 451 &view_, CompositorImpl::GetSurfaceManager(), this, frame_sink_id)); |
452 } | 452 } |
453 | 453 |
454 host_->SetView(this); | 454 host_->SetView(this); |
455 SetContentViewCore(content_view_core); | 455 SetContentViewCore(content_view_core); |
456 | 456 |
457 CreateOverscrollControllerIfPossible(); | 457 CreateOverscrollControllerIfPossible(); |
458 | 458 |
459 if (GetTextInputManager()) | 459 if (GetTextInputManager()) |
460 GetTextInputManager()->AddObserver(this); | 460 GetTextInputManager()->AddObserver(this); |
461 } | 461 } |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 1986 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
1987 if (!compositor) | 1987 if (!compositor) |
1988 return; | 1988 return; |
1989 | 1989 |
1990 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 1990 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
1991 overscroll_refresh_handler, compositor, | 1991 overscroll_refresh_handler, compositor, |
1992 ui::GetScaleFactorForNativeView(GetNativeView())); | 1992 ui::GetScaleFactorForNativeView(GetNativeView())); |
1993 } | 1993 } |
1994 | 1994 |
1995 } // namespace content | 1995 } // namespace content |
OLD | NEW |