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

Unified Diff: chrome/browser/favicon/favicon_tab_helper.cc

Issue 10837090: Change return type of FaviconTabHelper::GetFavicon() to gfx::Image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_tab_helper.cc
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index 2d0eda34d4305d19228bc78c3937ebb03454e097..a0e833a3357e28b7b9a1b4c9689039343d6a0e00 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -49,18 +49,18 @@ void FaviconTabHelper::FetchFavicon(const GURL& url) {
touch_icon_handler_->FetchFavicon(url);
}
-SkBitmap FaviconTabHelper::GetFavicon() const {
+gfx::Image FaviconTabHelper::GetFavicon() const {
// Like GetTitle(), we also want to use the favicon for the last committed
// entry rather than a pending navigation entry.
const NavigationController& controller = web_contents()->GetController();
NavigationEntry* entry = controller.GetTransientEntry();
if (entry)
- return entry->GetFavicon().AsBitmap();
+ return entry->GetFavicon().image;
entry = controller.GetLastCommittedEntry();
if (entry)
- return entry->GetFavicon().AsBitmap();
- return SkBitmap();
+ return entry->GetFavicon().image;
+ return gfx::Image();
}
bool FaviconTabHelper::FaviconIsValid() const {
@@ -112,7 +112,8 @@ void FaviconTabHelper::SaveFavicon() {
}
std::vector<unsigned char> image_data;
// TODO: Save all representations.
- gfx::PNGCodec::EncodeBGRASkBitmap(favicon.AsBitmap(), false, &image_data);
+ gfx::PNGCodec::EncodeBGRASkBitmap(
+ favicon.image.AsBitmap(), false, &image_data);
service->SetFavicon(
entry->GetURL(), favicon.url, image_data, history::FAVICON);
}
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698