OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/android/tab_base_android_impl.h" | 5 #include "chrome/browser/android/tab_base_android_impl.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" | 9 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
10 #include "chrome/browser/net/url_fixer_upper.h" | 10 #include "chrome/browser/net/url_fixer_upper.h" |
11 #include "chrome/browser/ui/android/window_android_helper.h" | 11 #include "chrome/browser/ui/android/window_android_helper.h" |
12 #include "content/public/browser/android/content_view_core.h" | 12 #include "content/public/browser/android/content_view_core.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "jni/TabBase_jni.h" | 15 #include "jni/TabBase_jni.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSuppor
t.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
17 #include "ui/gfx/android/window_android.h" | 19 #include "ui/gfx/android/window_android.h" |
18 | 20 |
19 using base::android::ConvertJavaStringToUTF8; | 21 using base::android::ConvertJavaStringToUTF8; |
20 using base::android::ConvertUTF8ToJavaString; | 22 using base::android::ConvertUTF8ToJavaString; |
21 using base::android::ScopedJavaLocalRef; | 23 using base::android::ScopedJavaLocalRef; |
22 using chrome::android::ChromeWebContentsDelegateAndroid; | 24 using chrome::android::ChromeWebContentsDelegateAndroid; |
23 using content::WebContents; | 25 using content::WebContents; |
24 using ui::WindowAndroid; | 26 using ui::WindowAndroid; |
25 | 27 |
(...skipping 25 matching lines...) Expand all Loading... |
51 TabBaseAndroidImpl* tab_android_impl_; | 53 TabBaseAndroidImpl* tab_android_impl_; |
52 | 54 |
53 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsDelegateRenderAndroid); | 55 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsDelegateRenderAndroid); |
54 }; | 56 }; |
55 } // namespace | 57 } // namespace |
56 | 58 |
57 TabBaseAndroidImpl::TabBaseAndroidImpl(JNIEnv* env, | 59 TabBaseAndroidImpl::TabBaseAndroidImpl(JNIEnv* env, |
58 jobject obj, | 60 jobject obj, |
59 WebContents* web_contents, | 61 WebContents* web_contents, |
60 WindowAndroid* window_android) | 62 WindowAndroid* window_android) |
61 : web_contents_(web_contents), | 63 : web_contents_(web_contents) { |
62 tab_layer_(WebKit::WebLayer::create()) { | 64 tab_layer_.reset( |
| 65 WebKit::Platform::current()->compositorSupport()->createLayer()); |
63 InitTabHelpers(web_contents); | 66 InitTabHelpers(web_contents); |
64 WindowAndroidHelper::FromWebContents(web_contents)-> | 67 WindowAndroidHelper::FromWebContents(web_contents)-> |
65 SetWindowAndroid(window_android); | 68 SetWindowAndroid(window_android); |
66 } | 69 } |
67 | 70 |
68 TabBaseAndroidImpl::~TabBaseAndroidImpl() { | 71 TabBaseAndroidImpl::~TabBaseAndroidImpl() { |
69 } | 72 } |
70 | 73 |
71 void TabBaseAndroidImpl::Destroy(JNIEnv* env, jobject obj) { | 74 void TabBaseAndroidImpl::Destroy(JNIEnv* env, jobject obj) { |
72 delete this; | 75 delete this; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 jobject obj, | 139 jobject obj, |
137 jint web_contents_ptr, | 140 jint web_contents_ptr, |
138 jint window_android_ptr) { | 141 jint window_android_ptr) { |
139 TabBaseAndroidImpl* tab = new TabBaseAndroidImpl( | 142 TabBaseAndroidImpl* tab = new TabBaseAndroidImpl( |
140 env, | 143 env, |
141 obj, | 144 obj, |
142 reinterpret_cast<WebContents*>(web_contents_ptr), | 145 reinterpret_cast<WebContents*>(web_contents_ptr), |
143 reinterpret_cast<WindowAndroid*>(window_android_ptr)); | 146 reinterpret_cast<WindowAndroid*>(window_android_ptr)); |
144 return reinterpret_cast<jint>(tab); | 147 return reinterpret_cast<jint>(tab); |
145 } | 148 } |
OLD | NEW |