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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 process->FastShutdownForPageCount(1); | 427 process->FastShutdownForPageCount(1); |
428 | 428 |
429 web_contents_.reset(); | 429 web_contents_.reset(); |
430 synced_tab_delegate_->ResetWebContents(); | 430 synced_tab_delegate_->ResetWebContents(); |
431 } else { | 431 } else { |
432 // Release the WebContents so it does not get deleted by the scoped_ptr. | 432 // Release the WebContents so it does not get deleted by the scoped_ptr. |
433 ignore_result(web_contents_.release()); | 433 ignore_result(web_contents_.release()); |
434 } | 434 } |
435 } | 435 } |
436 | 436 |
| 437 void TabAndroid::OnPhysicalBackingSizeChanged( |
| 438 JNIEnv* env, |
| 439 const JavaParamRef<jobject>& obj, |
| 440 const JavaParamRef<jobject>& jweb_contents, |
| 441 jint width, |
| 442 jint height) { |
| 443 content::WebContents* web_contents = |
| 444 content::WebContents::FromJavaWebContents(jweb_contents); |
| 445 gfx::Size size(width, height); |
| 446 web_contents->GetNativeView()->OnPhysicalBackingSizeChanged(size); |
| 447 } |
| 448 |
437 base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetProfileAndroid( | 449 base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetProfileAndroid( |
438 JNIEnv* env, | 450 JNIEnv* env, |
439 const JavaParamRef<jobject>& obj) { | 451 const JavaParamRef<jobject>& obj) { |
440 Profile* profile = GetProfile(); | 452 Profile* profile = GetProfile(); |
441 if (!profile) | 453 if (!profile) |
442 return base::android::ScopedJavaLocalRef<jobject>(); | 454 return base::android::ScopedJavaLocalRef<jobject>(); |
443 ProfileAndroid* profile_android = ProfileAndroid::FromProfile(profile); | 455 ProfileAndroid* profile_android = ProfileAndroid::FromProfile(profile); |
444 if (!profile_android) | 456 if (!profile_android) |
445 return base::android::ScopedJavaLocalRef<jobject>(); | 457 return base::android::ScopedJavaLocalRef<jobject>(); |
446 | 458 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 792 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
781 TRACE_EVENT0("native", "TabAndroid::Init"); | 793 TRACE_EVENT0("native", "TabAndroid::Init"); |
782 // This will automatically bind to the Java object and pass ownership there. | 794 // This will automatically bind to the Java object and pass ownership there. |
783 new TabAndroid(env, obj); | 795 new TabAndroid(env, obj); |
784 } | 796 } |
785 | 797 |
786 // static | 798 // static |
787 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 799 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
788 return RegisterNativesImpl(env); | 800 return RegisterNativesImpl(env); |
789 } | 801 } |
OLD | NEW |