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/favicon/favicon_tab_helper.h" | 5 #include "chrome/browser/favicon/favicon_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/favicon/favicon_handler.h" | 8 #include "chrome/browser/favicon/favicon_handler.h" |
9 #include "chrome/browser/favicon/favicon_service_factory.h" | 9 #include "chrome/browser/favicon/favicon_service_factory.h" |
10 #include "chrome/browser/favicon/favicon_util.h" | 10 #include "chrome/browser/favicon/favicon_util.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return false; | 81 return false; |
82 } | 82 } |
83 | 83 |
84 bool FaviconTabHelper::ShouldDisplayFavicon() { | 84 bool FaviconTabHelper::ShouldDisplayFavicon() { |
85 // Always display a throbber during pending loads. | 85 // Always display a throbber during pending loads. |
86 const NavigationController& controller = web_contents()->GetController(); | 86 const NavigationController& controller = web_contents()->GetController(); |
87 if (controller.GetLastCommittedEntry() && controller.GetPendingEntry()) | 87 if (controller.GetLastCommittedEntry() && controller.GetPendingEntry()) |
88 return true; | 88 return true; |
89 | 89 |
90 GURL url = web_contents()->GetURL(); | 90 GURL url = web_contents()->GetURL(); |
91 if (url.SchemeIs(chrome::kChromeUIScheme) && | 91 if (url.SchemeIs(content::kChromeUIScheme) && |
92 url.host() == chrome::kChromeUINewTabHost) { | 92 url.host() == chrome::kChromeUINewTabHost) { |
93 return false; | 93 return false; |
94 } | 94 } |
95 | 95 |
96 // No favicon on Instant New Tab Pages. | 96 // No favicon on Instant New Tab Pages. |
97 if (chrome::IsInstantNTP(web_contents())) | 97 if (chrome::IsInstantNTP(web_contents())) |
98 return false; | 98 return false; |
99 | 99 |
100 return true; | 100 return true; |
101 } | 101 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 favicon_service->UnableToDownloadFavicon(image_url); | 202 favicon_service->UnableToDownloadFavicon(image_url); |
203 } | 203 } |
204 | 204 |
205 favicon_handler_->OnDidDownloadFavicon( | 205 favicon_handler_->OnDidDownloadFavicon( |
206 id, image_url, bitmaps, original_bitmap_sizes); | 206 id, image_url, bitmaps, original_bitmap_sizes); |
207 if (touch_icon_handler_.get()) { | 207 if (touch_icon_handler_.get()) { |
208 touch_icon_handler_->OnDidDownloadFavicon( | 208 touch_icon_handler_->OnDidDownloadFavicon( |
209 id, image_url, bitmaps, original_bitmap_sizes); | 209 id, image_url, bitmaps, original_bitmap_sizes); |
210 } | 210 } |
211 } | 211 } |
OLD | NEW |