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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 skia::ImageOperations::RESIZE_BEST, | 680 skia::ImageOperations::RESIZE_BEST, |
681 target_size_dip, | 681 target_size_dip, |
682 target_size_dip); | 682 target_size_dip); |
683 } | 683 } |
684 | 684 |
685 bitmap = gfx::ConvertToJavaBitmap(&favicon); | 685 bitmap = gfx::ConvertToJavaBitmap(&favicon); |
686 } | 686 } |
687 return bitmap; | 687 return bitmap; |
688 } | 688 } |
689 | 689 |
| 690 SkBitmap TabAndroid::GetFaviconBitmap() { |
| 691 JNIEnv* env = base::android::AttachCurrentThread(); |
| 692 ScopedJavaLocalRef<jobject> javaBitmap = |
| 693 Java_Tab_getFavicon(env, weak_java_tab_.get(env).obj()); |
| 694 if (!javaBitmap.obj()) |
| 695 return SkBitmap(); |
| 696 |
| 697 return gfx::CreateSkBitmapFromJavaBitmap(gfx::JavaBitmap(javaBitmap.obj())); |
| 698 } |
| 699 |
690 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const { | 700 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const { |
691 Profile* profile = GetProfile(); | 701 Profile* profile = GetProfile(); |
692 if (!profile) | 702 if (!profile) |
693 return NULL; | 703 return NULL; |
694 return prerender::PrerenderManagerFactory::GetForProfile(profile); | 704 return prerender::PrerenderManagerFactory::GetForProfile(profile); |
695 } | 705 } |
696 | 706 |
697 // static | 707 // static |
698 void TabAndroid::CreateHistoricalTabFromContents(WebContents* web_contents) { | 708 void TabAndroid::CreateHistoricalTabFromContents(WebContents* web_contents) { |
699 DCHECK(web_contents); | 709 DCHECK(web_contents); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 // s^{n+1} / s^{n} = 2100 / 2000 | 880 // s^{n+1} / s^{n} = 2100 / 2000 |
871 // s = 1.05 | 881 // s = 1.05 |
872 // s^b = 60000 | 882 // s^b = 60000 |
873 // b = ln(60000) / ln(1.05) ~= 225 | 883 // b = ln(60000) / ln(1.05) ~= 225 |
874 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", | 884 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", |
875 base::Time::Now() - chrome::android::GetMainEntryPointTime(), | 885 base::Time::Now() - chrome::android::GetMainEntryPointTime(), |
876 base::TimeDelta::FromMilliseconds(1), | 886 base::TimeDelta::FromMilliseconds(1), |
877 base::TimeDelta::FromMinutes(1), | 887 base::TimeDelta::FromMinutes(1), |
878 225); | 888 225); |
879 } | 889 } |
OLD | NEW |