OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/fav_icon_helper.h" | 5 #include "chrome/browser/fav_icon_helper.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/ref_counted_memory.h" | 12 #include "base/ref_counted_memory.h" |
13 #include "chrome/browser/bookmarks/bookmark_model.h" | 13 #include "chrome/browser/bookmarks/bookmark_model.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" |
16 #include "chrome/browser/tab_contents/navigation_controller.h" | 16 #include "chrome/browser/tab_contents/navigation_controller.h" |
17 #include "chrome/browser/tab_contents/navigation_entry.h" | 17 #include "chrome/browser/tab_contents/navigation_entry.h" |
18 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 18 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
19 #include "chrome/browser/tab_contents/tab_contents.h" | 19 #include "chrome/browser/tab_contents/tab_contents.h" |
20 #include "chrome/common/render_messages.h" | 20 #include "chrome/common/render_messages.h" |
21 #include "gfx/codec/png_codec.h" | |
22 #include "gfx/favicon_size.h" | |
23 #include "skia/ext/image_operations.h" | 21 #include "skia/ext/image_operations.h" |
| 22 #include "ui/gfx/codec/png_codec.h" |
| 23 #include "ui/gfx/favicon_size.h" |
24 | 24 |
25 FavIconHelper::FavIconHelper(TabContents* tab_contents) | 25 FavIconHelper::FavIconHelper(TabContents* tab_contents) |
26 : tab_contents_(tab_contents), | 26 : tab_contents_(tab_contents), |
27 got_fav_icon_url_(false), | 27 got_fav_icon_url_(false), |
28 got_fav_icon_from_history_(false), | 28 got_fav_icon_from_history_(false), |
29 fav_icon_expired_(false) { | 29 fav_icon_expired_(false) { |
30 } | 30 } |
31 | 31 |
32 FavIconHelper::~FavIconHelper() { | 32 FavIconHelper::~FavIconHelper() { |
33 SkBitmap empty_image; | 33 SkBitmap empty_image; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 | 308 |
309 bool FavIconHelper::ShouldSaveFavicon(const GURL& url) { | 309 bool FavIconHelper::ShouldSaveFavicon(const GURL& url) { |
310 if (!profile()->IsOffTheRecord()) | 310 if (!profile()->IsOffTheRecord()) |
311 return true; | 311 return true; |
312 | 312 |
313 // Otherwise store the favicon if the page is bookmarked. | 313 // Otherwise store the favicon if the page is bookmarked. |
314 BookmarkModel* bookmark_model = profile()->GetBookmarkModel(); | 314 BookmarkModel* bookmark_model = profile()->GetBookmarkModel(); |
315 return bookmark_model && bookmark_model->IsBookmarked(url); | 315 return bookmark_model && bookmark_model->IsBookmarked(url); |
316 } | 316 } |
OLD | NEW |