OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/devtools_bridge/test/android/client/web_client_android.h" | |
6 | |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/browser/profiles/profile_android.h" | |
9 #include "jni/WebClient_jni.h" | |
10 | |
11 namespace devtools_bridge { | |
12 namespace android { | |
13 | |
14 bool WebClientAndroid::RegisterNatives(JNIEnv* env) { | |
15 return RegisterNativesImpl(env); | |
16 } | |
17 | |
18 WebClientAndroid::WebClientAndroid(Profile* profile) | |
19 : impl_(WebClient::CreateInstance(profile, this)) { | |
20 } | |
21 | |
22 WebClientAndroid::~WebClientAndroid() { | |
23 } | |
24 | |
25 static jlong CreateWebClient(JNIEnv* env, jclass jcaller, jobject j_profile) { | |
26 Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); | |
27 return reinterpret_cast<jlong>(new WebClientAndroid(profile)); | |
28 } | |
29 | |
30 static void DestroyWebClient( | |
31 JNIEnv* env, jclass jcaller, jlong web_client_ptr) { | |
32 delete reinterpret_cast<WebClientAndroid*>(web_client_ptr); | |
33 } | |
34 | |
35 } // namespace android | |
36 } // namespace devtools_bridge | |
OLD | NEW |