summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 21:56:48 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 21:56:48 +0000
commit0189bc72c90fab03afab623d0b2d8be3d35af3e7 (patch)
treea1962c2ecddcaf1eb1f1a27f6dde6991d19a9b07 /chrome/browser/profile.cc
parent34a6418e00deca16a311b331ab4b2f257c674d74 (diff)
downloadchromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.zip
chromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.tar.gz
chromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.tar.bz2
Adds a FaviconService class tied to the profile.
Original issue: http://codereview.chromium.org/115212/show The favicons service is the entry point to getting favicons. Make the DOMUIFactory handle the favicons of DOMUI pages so since DOMUI pages are never added to the history. BUG=5840 TEST=Open a new window and open history and downloads (Ctrl+H and Ctrl+J) in this window. Then close the window and open the NTP. The recently closed windows/tabs should show the favicons for the hsitroy and downloads page. Review URL: http://codereview.chromium.org/178001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 77d4ff1..66891d7 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/user_script_master.h"
+#include "chrome/browser/favicon_service.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/net/chrome_url_request_context.h"
@@ -257,6 +258,15 @@ class OffTheRecordProfileImpl : public Profile,
}
}
+ virtual FaviconService* GetFaviconService(ServiceAccessType sat) {
+ if (sat == EXPLICIT_ACCESS) {
+ return profile_->GetFaviconService(sat);
+ } else {
+ NOTREACHED() << "This profile is OffTheRecord";
+ return NULL;
+ }
+ }
+
virtual WebDataService* GetWebDataService(ServiceAccessType sat) {
if (sat == EXPLICIT_ACCESS) {
return profile_->GetWebDataService(sat);
@@ -505,6 +515,7 @@ ProfileImpl::ProfileImpl(const FilePath& path)
extensions_request_context_(NULL),
blacklist_(NULL),
history_service_created_(false),
+ favicon_service_created_(false),
created_web_data_service_(false),
created_password_store_(false),
created_download_manager_(false),
@@ -702,6 +713,10 @@ ProfileImpl::~ProfileImpl() {
history_service_ = NULL;
bookmark_bar_model_.reset();
+ // FaviconService depends on HistoryServce so make sure we delete
+ // HistoryService first.
+ favicon_service_ = NULL;
+
extension_message_service_->ProfileDestroyed();
if (extensions_service_)
@@ -861,6 +876,15 @@ URLRequestContext* ProfileImpl::GetRequestContextForMedia() {
return media_request_context_;
}
+FaviconService* ProfileImpl::GetFaviconService(ServiceAccessType sat) {
+ if (!favicon_service_created_) {
+ favicon_service_created_ = true;
+ scoped_refptr<FaviconService> service(new FaviconService(this));
+ favicon_service_.swap(service);
+ }
+ return favicon_service_.get();
+}
+
URLRequestContext* ProfileImpl::GetRequestContextForExtensions() {
if (!extensions_request_context_) {
FilePath cookie_path = GetPath();