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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 printing::PrintViewManagerBasic::CreateForWebContents(web_contents()); | 641 printing::PrintViewManagerBasic::CreateForWebContents(web_contents()); |
642 printing::PrintViewManagerBasic* print_view_manager = | 642 printing::PrintViewManagerBasic* print_view_manager = |
643 printing::PrintViewManagerBasic::FromWebContents(web_contents()); | 643 printing::PrintViewManagerBasic::FromWebContents(web_contents()); |
644 if (print_view_manager == NULL) | 644 if (print_view_manager == NULL) |
645 return false; | 645 return false; |
646 | 646 |
647 print_view_manager->PrintNow(); | 647 print_view_manager->PrintNow(); |
648 return true; | 648 return true; |
649 } | 649 } |
650 | 650 |
| 651 void TabAndroid::SetPendingPrint() { |
| 652 LOG(INFO) << "DGN TabAndroid::SetPendingPrint"; |
| 653 JNIEnv* env = base::android::AttachCurrentThread(); |
| 654 Java_Tab_setPendingPrint(env, weak_java_tab_.get(env).obj()); |
| 655 } |
| 656 |
651 ScopedJavaLocalRef<jobject> TabAndroid::GetDefaultFavicon(JNIEnv* env, | 657 ScopedJavaLocalRef<jobject> TabAndroid::GetDefaultFavicon(JNIEnv* env, |
652 jobject obj) { | 658 jobject obj) { |
653 ScopedJavaLocalRef<jobject> bitmap; | 659 ScopedJavaLocalRef<jobject> bitmap; |
654 FaviconTabHelper* favicon_tab_helper = | 660 FaviconTabHelper* favicon_tab_helper = |
655 FaviconTabHelper::FromWebContents(web_contents_.get()); | 661 FaviconTabHelper::FromWebContents(web_contents_.get()); |
656 | 662 |
657 if (!favicon_tab_helper) | 663 if (!favicon_tab_helper) |
658 return bitmap; | 664 return bitmap; |
659 | 665 |
660 // Always return the default favicon in Android. | 666 // Always return the default favicon in Android. |
(...skipping 25 matching lines...) Expand all Loading... |
686 | 692 |
687 static void Init(JNIEnv* env, jobject obj) { | 693 static void Init(JNIEnv* env, jobject obj) { |
688 TRACE_EVENT0("native", "TabAndroid::Init"); | 694 TRACE_EVENT0("native", "TabAndroid::Init"); |
689 // This will automatically bind to the Java object and pass ownership there. | 695 // This will automatically bind to the Java object and pass ownership there. |
690 new TabAndroid(env, obj); | 696 new TabAndroid(env, obj); |
691 } | 697 } |
692 | 698 |
693 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 699 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
694 return RegisterNativesImpl(env); | 700 return RegisterNativesImpl(env); |
695 } | 701 } |
OLD | NEW |