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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 skia::ImageOperations::RESIZE_BEST, | 628 skia::ImageOperations::RESIZE_BEST, |
629 target_size_dip, | 629 target_size_dip, |
630 target_size_dip); | 630 target_size_dip); |
631 } | 631 } |
632 | 632 |
633 bitmap = gfx::ConvertToJavaBitmap(&favicon); | 633 bitmap = gfx::ConvertToJavaBitmap(&favicon); |
634 } | 634 } |
635 return bitmap; | 635 return bitmap; |
636 } | 636 } |
637 | 637 |
| 638 jboolean TabAndroid::IsFaviconValid(JNIEnv* env, jobject jobj) { |
| 639 return web_contents() && |
| 640 FaviconTabHelper::FromWebContents(web_contents())->FaviconIsValid(); |
| 641 } |
| 642 |
638 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const { | 643 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const { |
639 Profile* profile = GetProfile(); | 644 Profile* profile = GetProfile(); |
640 if (!profile) | 645 if (!profile) |
641 return NULL; | 646 return NULL; |
642 return prerender::PrerenderManagerFactory::GetForProfile(profile); | 647 return prerender::PrerenderManagerFactory::GetForProfile(profile); |
643 } | 648 } |
644 | 649 |
645 static void Init(JNIEnv* env, jobject obj) { | 650 static void Init(JNIEnv* env, jobject obj) { |
646 TRACE_EVENT0("native", "TabAndroid::Init"); | 651 TRACE_EVENT0("native", "TabAndroid::Init"); |
647 // This will automatically bind to the Java object and pass ownership there. | 652 // This will automatically bind to the Java object and pass ownership there. |
648 new TabAndroid(env, obj); | 653 new TabAndroid(env, obj); |
649 } | 654 } |
650 | 655 |
651 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 656 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
652 return RegisterNativesImpl(env); | 657 return RegisterNativesImpl(env); |
653 } | 658 } |
OLD | NEW |