OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 Profile::IMPLICIT_ACCESS); | 851 Profile::IMPLICIT_ACCESS); |
852 if (!service) | 852 if (!service) |
853 return; | 853 return; |
854 const NavigationEntry::FaviconStatus& favicon(entry->favicon()); | 854 const NavigationEntry::FaviconStatus& favicon(entry->favicon()); |
855 if (!favicon.is_valid() || favicon.url().is_empty() || | 855 if (!favicon.is_valid() || favicon.url().is_empty() || |
856 favicon.bitmap().empty()) { | 856 favicon.bitmap().empty()) { |
857 return; | 857 return; |
858 } | 858 } |
859 std::vector<unsigned char> image_data; | 859 std::vector<unsigned char> image_data; |
860 gfx::PNGCodec::EncodeBGRASkBitmap(favicon.bitmap(), false, &image_data); | 860 gfx::PNGCodec::EncodeBGRASkBitmap(favicon.bitmap(), false, &image_data); |
861 service->SetFavicon(entry->url(), favicon.url(), image_data); | 861 service->SetFavicon( |
| 862 entry->url(), favicon.url(), image_data, history::FAV_ICON); |
862 } | 863 } |
863 | 864 |
864 ConstrainedWindow* TabContents::CreateConstrainedDialog( | 865 ConstrainedWindow* TabContents::CreateConstrainedDialog( |
865 ConstrainedWindowDelegate* delegate) { | 866 ConstrainedWindowDelegate* delegate) { |
866 ConstrainedWindow* window = | 867 ConstrainedWindow* window = |
867 ConstrainedWindow::CreateConstrainedDialog(this, delegate); | 868 ConstrainedWindow::CreateConstrainedDialog(this, delegate); |
868 AddConstrainedDialog(window); | 869 AddConstrainedDialog(window); |
869 return window; | 870 return window; |
870 } | 871 } |
871 | 872 |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 } | 2853 } |
2853 | 2854 |
2854 bool TabContents::MaybeUsePreloadedPage(const GURL& url) { | 2855 bool TabContents::MaybeUsePreloadedPage(const GURL& url) { |
2855 prerender::PrerenderManager* pm = profile()->GetPrerenderManager(); | 2856 prerender::PrerenderManager* pm = profile()->GetPrerenderManager(); |
2856 if (pm != NULL) { | 2857 if (pm != NULL) { |
2857 if (pm->MaybeUsePreloadedPage(this, url)) | 2858 if (pm->MaybeUsePreloadedPage(this, url)) |
2858 return true; | 2859 return true; |
2859 } | 2860 } |
2860 return false; | 2861 return false; |
2861 } | 2862 } |
OLD | NEW |