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