| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ | 5 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ |
| 6 #define COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ | 6 #define COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" |
| 10 #include "components/devtools_bridge/client/web_client.h" | 11 #include "components/devtools_bridge/client/web_client.h" |
| 11 | 12 |
| 12 class Profile; | 13 class Profile; |
| 13 | 14 |
| 14 namespace devtools_bridge { | 15 namespace devtools_bridge { |
| 15 namespace android { | 16 namespace android { |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * Android wrapper over WebClient for Java tests. See WebClientTest.java. | 19 * Android wrapper over WebClient for Java tests. See WebClientTest.java. |
| 19 */ | 20 */ |
| 20 class WebClientAndroid : private WebClient::Delegate { | 21 class WebClientAndroid : private WebClient::Delegate { |
| 21 public: | 22 public: |
| 22 static bool RegisterNatives(JNIEnv* env); | 23 static bool RegisterNatives(JNIEnv* env); |
| 23 | 24 |
| 24 WebClientAndroid(Profile* profile); | 25 WebClient& impl() { return *impl_.get(); } |
| 26 |
| 27 WebClientAndroid(Profile* profile, JNIEnv* env, jobject j_delegate); |
| 25 ~WebClientAndroid(); | 28 ~WebClientAndroid(); |
| 26 | 29 |
| 27 private: | 30 private: |
| 31 void SendCommand( |
| 32 const std::string& command, |
| 33 const WebClient::CommandSuccessCallback& sucess_callback, |
| 34 const WebClient::CommandFailureCallback& failure_callback) override; |
| 35 |
| 28 scoped_ptr<WebClient> impl_; | 36 scoped_ptr<WebClient> impl_; |
| 37 base::android::ScopedJavaGlobalRef<jobject> delegate_; |
| 29 }; | 38 }; |
| 30 | 39 |
| 31 } // namespace android | 40 } // namespace android |
| 32 } // namespace devtools_bridge | 41 } // namespace devtools_bridge |
| 33 | 42 |
| 34 #endif // COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ | 43 #endif // COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_ |
| OLD | NEW |