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

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

Issue 2391263005: Propagate error messages to UI for blimp. (Closed)
Patch Set: Minor fixes. Created 4 years, 2 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
« no previous file with comments | « blimp/client/core/context/blimp_client_context_impl.h ('k') | blimp/client/core/session/identity_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/context/blimp_client_context_impl.cc
diff --git a/blimp/client/core/context/blimp_client_context_impl.cc b/blimp/client/core/context/blimp_client_context_impl.cc
index e9eda6ae2de473637f806adc9f7556721a620a36..b8278ecfe3b0628a4417df974ec42df1da24f9e2 100644
--- a/blimp/client/core/context/blimp_client_context_impl.cc
+++ b/blimp/client/core/context/blimp_client_context_impl.cc
@@ -108,6 +108,8 @@ BlimpClientContextImpl::BlimpClientContextImpl(
RegisterFeatures();
InitializeSettings();
+ connection_status_.AddObserver(this);
+
// Initialize must only be posted after the features have been
// registered.
io_thread_task_runner_->PostTask(
@@ -119,6 +121,7 @@ BlimpClientContextImpl::BlimpClientContextImpl(
BlimpClientContextImpl::~BlimpClientContextImpl() {
io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release());
+ connection_status_.RemoveObserver(this);
}
void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) {
@@ -254,5 +257,21 @@ void BlimpClientContextImpl::OnImageDecodeError() {
DropConnection();
}
+void BlimpClientContextImpl::OnConnected() {
+ if (delegate_) {
+ delegate_->OnConnected();
+ }
+}
+
+void BlimpClientContextImpl::OnDisconnected(int result) {
+ if (delegate_) {
+ if (result >= 0) {
+ delegate_->OnEngineDisconnected(result);
+ } else {
+ delegate_->OnNetworkDisconnected(result);
+ }
+ }
+}
+
} // namespace client
} // namespace blimp
« no previous file with comments | « blimp/client/core/context/blimp_client_context_impl.h ('k') | blimp/client/core/session/identity_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698