| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 JNIEnv* env, | 423 JNIEnv* env, |
| 424 const JavaParamRef<jobject>& obj, | 424 const JavaParamRef<jobject>& obj, |
| 425 const JavaParamRef<jobject>& j_profile) { | 425 const JavaParamRef<jobject>& j_profile) { |
| 426 Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile.obj()); | 426 Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile.obj()); |
| 427 DCHECK(!profile->IsOffTheRecord()); | 427 DCHECK(!profile->IsOffTheRecord()); |
| 428 blimp::client::BlimpClientContext* context = | 428 blimp::client::BlimpClientContext* context = |
| 429 BlimpClientContextFactory::GetForBrowserContext(profile); | 429 BlimpClientContextFactory::GetForBrowserContext(profile); |
| 430 DCHECK(context); | 430 DCHECK(context); |
| 431 blimp_contents_ = context->CreateBlimpContents(); | 431 blimp_contents_ = context->CreateBlimpContents(); |
| 432 DCHECK(blimp_contents_); | 432 DCHECK(blimp_contents_); |
| 433 |
| 434 // Attach the layer holding the tab contents to the |content_layer_|. |
| 435 content_layer_->InsertChild(blimp_contents_->GetNativeView()->GetLayer(), 0); |
| 436 |
| 433 return blimp_contents_->GetJavaObject(); | 437 return blimp_contents_->GetJavaObject(); |
| 434 } | 438 } |
| 435 | 439 |
| 436 void TabAndroid::UpdateDelegates( | 440 void TabAndroid::UpdateDelegates( |
| 437 JNIEnv* env, | 441 JNIEnv* env, |
| 438 const JavaParamRef<jobject>& obj, | 442 const JavaParamRef<jobject>& obj, |
| 439 const JavaParamRef<jobject>& jweb_contents_delegate, | 443 const JavaParamRef<jobject>& jweb_contents_delegate, |
| 440 const JavaParamRef<jobject>& jcontext_menu_populator) { | 444 const JavaParamRef<jobject>& jcontext_menu_populator) { |
| 441 ContextMenuHelper::FromWebContents(web_contents())->SetPopulator( | 445 ContextMenuHelper::FromWebContents(web_contents())->SetPopulator( |
| 442 jcontext_menu_populator); | 446 jcontext_menu_populator); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 902 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 899 TRACE_EVENT0("native", "TabAndroid::Init"); | 903 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 900 // This will automatically bind to the Java object and pass ownership there. | 904 // This will automatically bind to the Java object and pass ownership there. |
| 901 new TabAndroid(env, obj); | 905 new TabAndroid(env, obj); |
| 902 } | 906 } |
| 903 | 907 |
| 904 // static | 908 // static |
| 905 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 909 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 906 return RegisterNativesImpl(env); | 910 return RegisterNativesImpl(env); |
| 907 } | 911 } |
| OLD | NEW |