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

Unified Diff: blimp/client/core/settings/android/blimp_settings_android.h

Issue 2322843002: Propagate connection info to Blimp android UI. (Closed)
Patch Set: Merge conflicts. Created 4 years, 3 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/settings/BUILD.gn ('k') | blimp/client/core/settings/android/blimp_settings_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/settings/android/blimp_settings_android.h
diff --git a/blimp/client/core/settings/android/blimp_settings_android.h b/blimp/client/core/settings/android/blimp_settings_android.h
index 66154622e7624286f7276af7d97573d9a35b720c..871bb7c3282f229b4f5c6125cbe4115d59e84106 100644
--- a/blimp/client/core/settings/android/blimp_settings_android.h
+++ b/blimp/client/core/settings/android/blimp_settings_android.h
@@ -5,18 +5,23 @@
#ifndef BLIMP_CLIENT_CORE_SETTINGS_ANDROID_BLIMP_SETTINGS_ANDROID_H_
#define BLIMP_CLIENT_CORE_SETTINGS_ANDROID_BLIMP_SETTINGS_ANDROID_H_
+#include <memory>
+
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
#include "blimp/client/core/session/identity_source.h"
+#include "blimp/client/core/session/network_event_observer.h"
namespace blimp {
namespace client {
class BlimpClientContextImplAndroid;
+class BlimpSettingsDelegate;
// JNI bridge between AboutBlimpPreferences.java and native code.
-class BlimpSettingsAndroid : public IdentityProvider::Observer {
+class BlimpSettingsAndroid : public IdentityProvider::Observer,
+ public NetworkEventObserver {
public:
static bool RegisterJni(JNIEnv* env);
static BlimpSettingsAndroid* FromJavaObject(
@@ -28,21 +33,29 @@ class BlimpSettingsAndroid : public IdentityProvider::Observer {
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
- void SetIdentitySource(IdentitySource* identity_source);
+ void SetDelegate(BlimpSettingsDelegate* delegate);
+ private:
// Notify Java layer for user sign in state change.
- void OnSignedOut();
- void OnSignedIn();
+ void OnSignedOut() const;
+ void OnSignedIn() const;
+
+ // Update engine info in Java, this can be either connection end point or
+ // engine disconnection reason.
+ void UpdateEngineInfo() const;
// IdentityProvider::Observer implementation.
void OnActiveAccountLogout() override;
void OnActiveAccountLogin() override;
- private:
+ // NetworkEventObserver implementation.
+ void OnConnected() override;
+ void OnDisconnected(int result) override;
+
base::android::ScopedJavaGlobalRef<jobject> java_obj_;
- // IdentitySource that broadcasts sign in state change.
- IdentitySource* identity_source_;
+ // Delegate that provides functions needed by settings.
+ BlimpSettingsDelegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(BlimpSettingsAndroid);
};
« no previous file with comments | « blimp/client/core/settings/BUILD.gn ('k') | blimp/client/core/settings/android/blimp_settings_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698