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

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

Issue 8469018: Provide assumed favicon for intents if service provider page was never visited. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use COUNT(*) for existence test Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/favicon/favicon_service.h" 5 #include "chrome/browser/favicon/favicon_service.h"
6 6
7 #include "chrome/browser/history/history.h" 7 #include "chrome/browser/history/history.h"
8 #include "chrome/browser/history/history_backend.h" 8 #include "chrome/browser/history/history_backend.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" 10 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 return handle; 66 return handle;
67 } 67 }
68 68
69 void FaviconService::SetFaviconOutOfDateForPage(const GURL& page_url) { 69 void FaviconService::SetFaviconOutOfDateForPage(const GURL& page_url) {
70 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); 70 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
71 if (hs) 71 if (hs)
72 hs->SetFaviconOutOfDateForPage(page_url); 72 hs->SetFaviconOutOfDateForPage(page_url);
73 } 73 }
74 74
75 void FaviconService::CloneFavicon(const GURL& old_page_url,
76 const GURL& new_page_url) {
77 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
78 if (hs)
79 hs->CloneFavicon(old_page_url, new_page_url);
80 }
81
75 void FaviconService::SetImportedFavicons( 82 void FaviconService::SetImportedFavicons(
76 const std::vector<history::ImportedFaviconUsage>& favicon_usage) { 83 const std::vector<history::ImportedFaviconUsage>& favicon_usage) {
77 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); 84 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
78 if (hs) 85 if (hs)
79 hs->SetImportedFavicons(favicon_usage); 86 hs->SetImportedFavicons(favicon_usage);
80 } 87 }
81 88
82 void FaviconService::SetFavicon(const GURL& page_url, 89 void FaviconService::SetFavicon(const GURL& page_url,
83 const GURL& icon_url, 90 const GURL& icon_url,
84 const std::vector<unsigned char>& image_data, 91 const std::vector<unsigned char>& image_data,
85 history::IconType icon_type) { 92 history::IconType icon_type) {
86 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); 93 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
87 if (hs) 94 if (hs)
88 hs->SetFavicon(page_url, icon_url, image_data, icon_type); 95 hs->SetFavicon(page_url, icon_url, image_data, icon_type);
89 } 96 }
90 97
91 FaviconService::~FaviconService() { 98 FaviconService::~FaviconService() {
92 } 99 }
93 100
94 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) { 101 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) {
95 request->ForwardResultAsync(request->handle(), history::FaviconData()); 102 request->ForwardResultAsync(request->handle(), history::FaviconData());
96 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698