Index: components/devtools_bridge/test/android/client/web_client_android.cc |
diff --git a/components/devtools_bridge/test/android/client/web_client_android.cc b/components/devtools_bridge/test/android/client/web_client_android.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c43f89fc67aaef2290908875ce7dfe677405d4e |
--- /dev/null |
+++ b/components/devtools_bridge/test/android/client/web_client_android.cc |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
mnaganov (inactive)
2014/11/20 19:02:42
nit: remove "(c)"
SeRya
2014/11/20 21:10:39
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/devtools_bridge/test/android/client/web_client_android.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/profiles/profile_android.h" |
+#include "jni/WebClient_jni.h" |
+ |
+namespace devtools_bridge { |
+namespace android { |
+ |
+bool WebClientAndroid::RegisterNatives(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |
+ |
+WebClientAndroid::WebClientAndroid(Profile* profile) |
+ : impl_(WebClient::CreateInstance(profile, this)) { |
+} |
+ |
+WebClientAndroid::~WebClientAndroid() { |
+} |
+ |
+static jlong CreateWebClient(JNIEnv* env, jclass jcaller, jobject j_profile) { |
+ Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); |
+ return reinterpret_cast<jlong>(new WebClientAndroid(profile)); |
+} |
+ |
+static void DestroyWebClient( |
+ JNIEnv* env, jclass jcaller, jlong web_client_ptr) { |
+ delete reinterpret_cast<WebClientAndroid*>(web_client_ptr); |
+} |
+ |
+} // namespace android |
+} // namespace devtools_bridge |