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

Side by Side Diff: chrome/browser/favicon/favicon_utils.cc

Issue 2624983002: Remove default-page favicon for interstitials (Closed)
Patch Set: Add back the blank line Created 3 years, 11 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 | « no previous file | 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/favicon/favicon_utils.h" 5 #include "chrome/browser/favicon/favicon_utils.h"
6 6
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #include "chrome/browser/favicon/favicon_service_factory.h" 8 #include "chrome/browser/favicon/favicon_service_factory.h"
9 #include "chrome/browser/history/history_service_factory.h" 9 #include "chrome/browser/history/history_service_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 28 matching lines...) Expand all
39 ->GetOriginalProfile(); 39 ->GetOriginalProfile();
40 return ContentFaviconDriver::CreateForWebContents( 40 return ContentFaviconDriver::CreateForWebContents(
41 web_contents, FaviconServiceFactory::GetForProfile( 41 web_contents, FaviconServiceFactory::GetForProfile(
42 original_profile, ServiceAccessType::IMPLICIT_ACCESS), 42 original_profile, ServiceAccessType::IMPLICIT_ACCESS),
43 HistoryServiceFactory::GetForProfile(original_profile, 43 HistoryServiceFactory::GetForProfile(original_profile,
44 ServiceAccessType::IMPLICIT_ACCESS), 44 ServiceAccessType::IMPLICIT_ACCESS),
45 BookmarkModelFactory::GetForBrowserContextIfExists(original_profile)); 45 BookmarkModelFactory::GetForBrowserContextIfExists(original_profile));
46 } 46 }
47 47
48 bool ShouldDisplayFavicon(content::WebContents* web_contents) { 48 bool ShouldDisplayFavicon(content::WebContents* web_contents) {
49 // No favicon on interstitials. This check must be done first since
50 // interstitial navigations don't commit and always have a pending entry.
51 if (web_contents->ShowingInterstitialPage())
52 return false;
53
49 // Always display a throbber during pending loads. 54 // Always display a throbber during pending loads.
50 const content::NavigationController& controller = 55 const content::NavigationController& controller =
51 web_contents->GetController(); 56 web_contents->GetController();
52 if (controller.GetLastCommittedEntry() && controller.GetPendingEntry()) 57 if (controller.GetLastCommittedEntry() && controller.GetPendingEntry())
53 return true; 58 return true;
54 59
55 GURL url = web_contents->GetURL(); 60 GURL url = web_contents->GetURL();
56 if (url.SchemeIs(content::kChromeUIScheme) && 61 if (url.SchemeIs(content::kChromeUIScheme) &&
57 url.host_piece() == chrome::kChromeUINewTabHost) { 62 url.host_piece() == chrome::kChromeUINewTabHost) {
58 return false; 63 return false;
(...skipping 23 matching lines...) Expand all
82 kDesaturateLightness}; 87 kDesaturateLightness};
83 return gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage( 88 return gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage(
84 *favicon.ToImageSkia(), shift)); 89 *favicon.ToImageSkia(), shift));
85 } 90 }
86 } 91 }
87 92
88 return favicon; 93 return favicon;
89 } 94 }
90 95
91 } // namespace favicon 96 } // namespace favicon
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698