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

Unified Diff: blimp/client/core/blimp_client_context_impl.cc

Issue 2255533002: Add TabControlFeature to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
Index: blimp/client/core/blimp_client_context_impl.cc
diff --git a/blimp/client/core/blimp_client_context_impl.cc b/blimp/client/core/blimp_client_context_impl.cc
index f90b1dc02b222929b3e0851a1a240809064d7aa0..e3adc9b0a51901bed3a79d5c169b7385e3a7f483 100644
--- a/blimp/client/core/blimp_client_context_impl.cc
+++ b/blimp/client/core/blimp_client_context_impl.cc
@@ -49,6 +49,7 @@ BlimpClientContextImpl::BlimpClientContextImpl(
io_thread_task_runner_(io_thread_task_runner),
file_thread_task_runner_(file_thread_task_runner),
blimp_contents_manager_(new BlimpContentsManager),
+ tab_control_feature_(new TabControlFeature),
weak_factory_(this) {
net_components_.reset(new ClientNetworkComponents(
base::MakeUnique<CrossThreadNetworkEventObserver>(
@@ -59,6 +60,8 @@ BlimpClientContextImpl::BlimpClientContextImpl(
thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>(
io_thread_task_runner_, net_components_->GetBrowserConnectionHandler());
+ RegisterFeatures();
+
// Initialize must only be posted after the calls features have been
// registered.
io_thread_task_runner_->PostTask(
@@ -78,6 +81,11 @@ std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() {
std::unique_ptr<BlimpContents> blimp_contents =
blimp_contents_manager_->CreateBlimpContents();
delegate_->AttachBlimpContentsHelpers(blimp_contents.get());
+
+ BlimpContentsImpl* blimp_contents_impl =
+ static_cast<BlimpContentsImpl*>(blimp_contents.get());
+ blimp_contents_impl->SetTabControlFeature(tab_control_feature_.get());
nyquist 2016/08/16 20:41:04 Did you consider doing this in the constructor ins
Menglin 2016/08/16 21:10:09 Do you mean BlimpContentsImpl::BlimpContentsImpl(i
nyquist 2016/08/16 21:41:40 Yes, that's what I meant. I don't feel strongly ab
Menglin 2016/08/17 19:48:46 Done.
+
return blimp_contents;
}
@@ -98,6 +106,10 @@ void BlimpClientContextImpl::OnConnected() {}
void BlimpClientContextImpl::OnDisconnected(int result) {}
+TabControlFeature* BlimpClientContextImpl::GetTabControlFeature() const {
+ return tab_control_feature_.get();
+}
+
GURL BlimpClientContextImpl::GetAssignerURL() {
return GURL(kDefaultAssignerUrl);
}
@@ -122,5 +134,12 @@ void BlimpClientContextImpl::ConnectWithAssignment(
base::Unretained(net_components_.get()), assignment));
}
+void BlimpClientContextImpl::RegisterFeatures() {
+ // Register features' message senders and receivers.
+ tab_control_feature_->set_outgoing_message_processor(
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl,
+ tab_control_feature_.get()));
+}
+
} // namespace client
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698