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