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_android.h" | 5 #include "chrome/browser/android/tab_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bool did_start_load, | 222 bool did_start_load, |
223 bool did_finish_load) { | 223 bool did_finish_load) { |
224 JNIEnv* env = base::android::AttachCurrentThread(); | 224 JNIEnv* env = base::android::AttachCurrentThread(); |
225 | 225 |
226 // We need to notify the native InfobarContainer so infobars can be swapped. | 226 // We need to notify the native InfobarContainer so infobars can be swapped. |
227 InfoBarContainerAndroid* infobar_container = | 227 InfoBarContainerAndroid* infobar_container = |
228 reinterpret_cast<InfoBarContainerAndroid*>( | 228 reinterpret_cast<InfoBarContainerAndroid*>( |
229 Java_Tab_getNativeInfoBarContainer( | 229 Java_Tab_getNativeInfoBarContainer( |
230 env, | 230 env, |
231 weak_java_tab_.get(env).obj())); | 231 weak_java_tab_.get(env).obj())); |
232 InfoBarService* new_infobar_service = new_contents ? | 232 InfoBarManager* new_infobar_manager = new_contents ? |
233 InfoBarService::FromWebContents(new_contents) : NULL; | 233 &InfoBarService::FromWebContents(new_contents)->infobar_manager() : NULL; |
234 infobar_container->ChangeInfoBarService(new_infobar_service); | 234 infobar_container->ChangeInfoBarManager(new_infobar_manager); |
235 | 235 |
236 Java_Tab_swapWebContents( | 236 Java_Tab_swapWebContents( |
237 env, | 237 env, |
238 weak_java_tab_.get(env).obj(), | 238 weak_java_tab_.get(env).obj(), |
239 reinterpret_cast<intptr_t>(new_contents), | 239 reinterpret_cast<intptr_t>(new_contents), |
240 did_start_load, | 240 did_start_load, |
241 did_finish_load); | 241 did_finish_load); |
242 } | 242 } |
243 | 243 |
244 void TabAndroid::Observe(int type, | 244 void TabAndroid::Observe(int type, |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 512 |
513 static void Init(JNIEnv* env, jobject obj) { | 513 static void Init(JNIEnv* env, jobject obj) { |
514 TRACE_EVENT0("native", "TabAndroid::Init"); | 514 TRACE_EVENT0("native", "TabAndroid::Init"); |
515 // This will automatically bind to the Java object and pass ownership there. | 515 // This will automatically bind to the Java object and pass ownership there. |
516 new TabAndroid(env, obj); | 516 new TabAndroid(env, obj); |
517 } | 517 } |
518 | 518 |
519 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 519 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
520 return RegisterNativesImpl(env); | 520 return RegisterNativesImpl(env); |
521 } | 521 } |
OLD | NEW |