| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 printing::PrintViewManagerBasic::CreateForWebContents(web_contents()); | 638 printing::PrintViewManagerBasic::CreateForWebContents(web_contents()); |
| 639 printing::PrintViewManagerBasic* print_view_manager = | 639 printing::PrintViewManagerBasic* print_view_manager = |
| 640 printing::PrintViewManagerBasic::FromWebContents(web_contents()); | 640 printing::PrintViewManagerBasic::FromWebContents(web_contents()); |
| 641 if (print_view_manager == NULL) | 641 if (print_view_manager == NULL) |
| 642 return false; | 642 return false; |
| 643 | 643 |
| 644 print_view_manager->PrintNow(); | 644 print_view_manager->PrintNow(); |
| 645 return true; | 645 return true; |
| 646 } | 646 } |
| 647 | 647 |
| 648 void TabAndroid::SetPendingPrint() { |
| 649 JNIEnv* env = base::android::AttachCurrentThread(); |
| 650 Java_Tab_setPendingPrint(env, weak_java_tab_.get(env).obj()); |
| 651 } |
| 652 |
| 648 ScopedJavaLocalRef<jobject> TabAndroid::GetDefaultFavicon(JNIEnv* env, | 653 ScopedJavaLocalRef<jobject> TabAndroid::GetDefaultFavicon(JNIEnv* env, |
| 649 jobject obj) { | 654 jobject obj) { |
| 650 ScopedJavaLocalRef<jobject> bitmap; | 655 ScopedJavaLocalRef<jobject> bitmap; |
| 651 FaviconTabHelper* favicon_tab_helper = | 656 FaviconTabHelper* favicon_tab_helper = |
| 652 FaviconTabHelper::FromWebContents(web_contents_.get()); | 657 FaviconTabHelper::FromWebContents(web_contents_.get()); |
| 653 | 658 |
| 654 if (!favicon_tab_helper) | 659 if (!favicon_tab_helper) |
| 655 return bitmap; | 660 return bitmap; |
| 656 | 661 |
| 657 // Always return the default favicon in Android. | 662 // Always return the default favicon in Android. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 static void Init(JNIEnv* env, jobject obj) { | 715 static void Init(JNIEnv* env, jobject obj) { |
| 711 TRACE_EVENT0("native", "TabAndroid::Init"); | 716 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 712 // This will automatically bind to the Java object and pass ownership there. | 717 // This will automatically bind to the Java object and pass ownership there. |
| 713 new TabAndroid(env, obj); | 718 new TabAndroid(env, obj); |
| 714 } | 719 } |
| 715 | 720 |
| 716 // static | 721 // static |
| 717 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 722 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 718 return RegisterNativesImpl(env); | 723 return RegisterNativesImpl(env); |
| 719 } | 724 } |
| OLD | NEW |