| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 15 #include "content/shell/android/shell_manager.h" | 16 #include "content/shell/android/shell_manager.h" |
| 16 #include "jni/Shell_jni.h" | 17 #include "jni/Shell_jni.h" |
| 17 | 18 |
| 18 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 19 using base::android::ConvertUTF8ToJavaString; | 20 using base::android::ConvertUTF8ToJavaString; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { | 24 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 Java_Shell_setIsLoading(env, java_object_.obj(), loading); | 52 Java_Shell_setIsLoading(env, java_object_.obj(), loading); |
| 52 } | 53 } |
| 53 | 54 |
| 54 void Shell::PlatformCreateWindow(int width, int height) { | 55 void Shell::PlatformCreateWindow(int width, int height) { |
| 55 java_object_.Reset(AttachCurrentThread(), CreateShellView(this)); | 56 java_object_.Reset(AttachCurrentThread(), CreateShellView(this)); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void Shell::PlatformSetContents() { | 59 void Shell::PlatformSetContents() { |
| 59 JNIEnv* env = AttachCurrentThread(); | 60 JNIEnv* env = AttachCurrentThread(); |
| 60 Java_Shell_initFromNativeTabContents( | 61 Java_Shell_initFromNativeTabContents( |
| 61 env, java_object_.obj(), reinterpret_cast<intptr_t>(web_contents())); | 62 env, java_object_.obj(), web_contents()->GetJavaWebContents().obj()); |
| 62 } | 63 } |
| 63 | 64 |
| 64 void Shell::PlatformResizeSubViews() { | 65 void Shell::PlatformResizeSubViews() { |
| 65 // Not needed; subviews are bound. | 66 // Not needed; subviews are bound. |
| 66 } | 67 } |
| 67 | 68 |
| 68 void Shell::PlatformSetTitle(const base::string16& title) { | 69 void Shell::PlatformSetTitle(const base::string16& title) { |
| 69 NOTIMPLEMENTED() << ": " << title; | 70 NOTIMPLEMENTED() << ": " << title; |
| 70 } | 71 } |
| 71 | 72 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 102 return RegisterNativesImpl(env); | 103 return RegisterNativesImpl(env); |
| 103 } | 104 } |
| 104 | 105 |
| 105 // static | 106 // static |
| 106 void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) { | 107 void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) { |
| 107 Shell* shell = reinterpret_cast<Shell*>(shellPtr); | 108 Shell* shell = reinterpret_cast<Shell*>(shellPtr); |
| 108 shell->Close(); | 109 shell->Close(); |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace content | 112 } // namespace content |
| OLD | NEW |