Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: blimp/client/compositor/blimp_compositor.cc

Issue 1430623004: blimp: Add support for input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build error. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/client/compositor/blimp_compositor.h ('k') | blimp/client/input/blimp_input_handler_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/compositor/blimp_compositor.cc
diff --git a/blimp/client/compositor/blimp_compositor.cc b/blimp/client/compositor/blimp_compositor.cc
index 9c783dcc9cab919f17fc7194d01ad28f5a5871fb..a585996ddd430ffa8f7823c8ee6eb18df069f066 100644
--- a/blimp/client/compositor/blimp_compositor.cc
+++ b/blimp/client/compositor/blimp_compositor.cc
@@ -71,6 +71,10 @@ BlimpCompositor::~BlimpCompositor() {
// tasks on |compositor_thread_|.
host_.reset();
settings_.reset();
+
+ // We must destroy |host_| before the |input_manager_|.
+ input_manager_.reset();
+
if (compositor_thread_)
compositor_thread_->Stop();
}
@@ -131,6 +135,12 @@ void BlimpCompositor::ReleaseAcceleratedWidget() {
window_ = gfx::kNullAcceleratedWidget;
}
+bool BlimpCompositor::OnTouchEvent(const ui::MotionEvent& motion_event) {
+ if (input_manager_)
+ return input_manager_->OnTouchEvent(motion_event);
+ return false;
+}
+
void BlimpCompositor::WillBeginMainFrame() {}
void BlimpCompositor::DidBeginMainFrame() {}
@@ -189,6 +199,12 @@ void BlimpCompositor::OnRenderWidgetInitialized() {
// Destroy the old LayerTreeHost state.
host_.reset();
+ // Destroy the old input manager state.
+ // It is important to destroy the LayerTreeHost before destroying the input
+ // manager as it has a reference to the cc::InputHandlerClient owned by the
+ // BlimpInputManager.
+ input_manager_.reset();
+
// Reset other state.
output_surface_request_pending_ = false;
@@ -212,6 +228,11 @@ void BlimpCompositor::GenerateLayerTreeSettings(
PopulateCommonLayerTreeSettings(settings);
}
+void BlimpCompositor::SendWebInputEvent(
+ const blink::WebInputEvent& input_event) {
+ render_widget_processor_.SendInputEvent(kDummyTabId, input_event);
+}
+
void BlimpCompositor::CreateLayerTreeHost(
scoped_ptr<cc::proto::CompositorMessage> message) {
if (!settings_) {
@@ -244,6 +265,15 @@ void BlimpCompositor::CreateLayerTreeHost(
cc::Layer::Create(BlimpCompositor::LayerSettings()));
host_->SetRootLayer(root);
g_dummy_layer_driver.Pointer()->SetParentLayer(root);
+
+ // TODO(khushalsagar): Create this after successful initialization of the
+ // remote client compositor when implemented.
+ DCHECK(!input_manager_);
+ input_manager_ =
+ BlimpInputManager::Create(this,
+ base::ThreadTaskRunnerHandle::Get(),
+ GetCompositorTaskRunner(),
+ host_->GetInputHandler());
}
scoped_refptr<base::SingleThreadTaskRunner>
« no previous file with comments | « blimp/client/compositor/blimp_compositor.h ('k') | blimp/client/input/blimp_input_handler_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698