Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 1161903005: Revert of [DevTools] Fix favicon images on chrome://inspect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
700 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const { 690 prerender::PrerenderManager* TabAndroid::GetPrerenderManager() const {
701 Profile* profile = GetProfile(); 691 Profile* profile = GetProfile();
702 if (!profile) 692 if (!profile)
703 return NULL; 693 return NULL;
704 return prerender::PrerenderManagerFactory::GetForProfile(profile); 694 return prerender::PrerenderManagerFactory::GetForProfile(profile);
705 } 695 }
706 696
707 // static 697 // static
708 void TabAndroid::CreateHistoricalTabFromContents(WebContents* web_contents) { 698 void TabAndroid::CreateHistoricalTabFromContents(WebContents* web_contents) {
709 DCHECK(web_contents); 699 DCHECK(web_contents);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 // s^{n+1} / s^{n} = 2100 / 2000 870 // s^{n+1} / s^{n} = 2100 / 2000
881 // s = 1.05 871 // s = 1.05
882 // s^b = 60000 872 // s^b = 60000
883 // b = ln(60000) / ln(1.05) ~= 225 873 // b = ln(60000) / ln(1.05) ~= 225
884 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 874 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
885 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 875 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
886 base::TimeDelta::FromMilliseconds(1), 876 base::TimeDelta::FromMilliseconds(1),
887 base::TimeDelta::FromMinutes(1), 877 base::TimeDelta::FromMinutes(1),
888 225); 878 225);
889 } 879 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698