| Index: content/shell/shell_android.cc
|
| diff --git a/content/shell/shell_android.cc b/content/shell/shell_android.cc
|
| index ec51e7c1efe3e2dd11de51508b8bb5a401bc7b9e..a8fea3763d9bfb28986e314009f8dc501ad23271 100644
|
| --- a/content/shell/shell_android.cc
|
| +++ b/content/shell/shell_android.cc
|
| @@ -4,9 +4,17 @@
|
|
|
| #include "content/shell/shell.h"
|
|
|
| +#include <jni.h>
|
| +
|
| +#include "base/android/scoped_java_ref.h"
|
| +#include "base/android/jni_string.h"
|
| #include "base/logging.h"
|
| #include "base/string_piece.h"
|
| #include "content/shell/android/shell_manager.h"
|
| +#include "jni/shell_jni.h"
|
| +
|
| +using base::android::AttachCurrentThread;
|
| +using base::android::ConvertUTF8ToJavaString;
|
|
|
| namespace content {
|
|
|
| @@ -24,17 +32,23 @@ void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
|
| }
|
|
|
| void Shell::PlatformSetAddressBarURL(const GURL& url) {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + ScopedJavaLocalRef<jstring> j_url =
|
| + ConvertUTF8ToJavaString(env, url.spec());
|
| + Java_Shell_onUpdateUrl(env, java_object_.obj(), j_url.obj());
|
| }
|
|
|
| void Shell::PlatformSetIsLoading(bool loading) {
|
| }
|
|
|
| void Shell::PlatformCreateWindow(int width, int height) {
|
| - shell_view_.reset(CreateShellView());
|
| + java_object_.Reset(AttachCurrentThread(), CreateShellView());
|
| }
|
|
|
| void Shell::PlatformSetContents() {
|
| - shell_view_->InitFromTabContents(web_contents_.get());
|
| + JNIEnv* env = AttachCurrentThread();
|
| + Java_Shell_initFromNativeTabContents(
|
| + env, java_object_.obj(), reinterpret_cast<jint>(web_contents()));
|
| }
|
|
|
| void Shell::PlatformResizeSubViews() {
|
| @@ -45,9 +59,19 @@ void Shell::PlatformSetTitle(const string16& title) {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| +void Shell::LoadProgressChanged(double progress) {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + Java_Shell_onLoadProgressChanged(env, java_object_.obj(), progress);
|
| +}
|
| +
|
| void Shell::Close() {
|
| // TODO(tedchoc): Implement Close method for android shell
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| +// static
|
| +bool Shell::Register(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| } // namespace content
|
|
|