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

Unified Diff: remoting/host/android/jni_host.h

Issue 1888653002: [remoting android] Initialize It2Me host and implement Connect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase/re-upload since Reitveld is confused Created 4 years, 8 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 | « remoting/host/BUILD.gn ('k') | remoting/host/android/jni_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/android/jni_host.h
diff --git a/remoting/host/android/jni_host.h b/remoting/host/android/jni_host.h
index 7705af1d5bb4e4490bea7dfca9a5826dee1034f1..fb9cdaa67db08e0b536d9cd4ce113c4942a3ef3a 100644
--- a/remoting/host/android/jni_host.h
+++ b/remoting/host/android/jni_host.h
@@ -7,22 +7,58 @@
#include <jni.h>
+#include <memory>
+
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "remoting/host/it2me/it2me_host.h"
namespace remoting {
-class JniHost {
+class ChromotingHostContext;
+class It2MeHostFactory;
+
+class JniHost : public It2MeHost::Observer {
public:
JniHost();
- ~JniHost();
+ virtual ~JniHost();
// Register C++ methods exposed to Java using JNI.
static bool RegisterJni(JNIEnv* env);
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& caller);
+ void Connect(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& caller,
+ const base::android::JavaParamRef<jstring>& user_name,
+ const base::android::JavaParamRef<jstring>& auth_token);
+
+ void Disconnect(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& caller);
+
+ // It2MeHost::Observer implementation.
+ void OnClientAuthenticated(const std::string& client_username) override;
+ void OnStoreAccessCode(const std::string& access_code,
+ base::TimeDelta access_code_lifetime) override;
+ void OnNatPolicyChanged(bool nat_traversal_enabled) override;
+ void OnStateChanged(It2MeHostState state,
+ const std::string& error_message) override;
+
private:
+ std::unique_ptr<base::MessageLoopForUI> ui_loop_;
+ std::unique_ptr<ChromotingHostContext> host_context_;
+ std::unique_ptr<It2MeHostFactory> factory_;
+ scoped_refptr<It2MeHost> it2me_host_;
+
+ // IT2Me Talk server configuration used by |it2me_host_| to connect.
+ XmppSignalStrategy::XmppServerConfig xmpp_server_config_;
+
+ base::WeakPtr<JniHost> weak_ptr_;
+ base::WeakPtrFactory<JniHost> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(JniHost);
};
« no previous file with comments | « remoting/host/BUILD.gn ('k') | remoting/host/android/jni_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698