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

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

Issue 10828263: Moving FaviconService to a ProfileKeyedService. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "chrome/browser/cancelable_request.h" 12 #include "chrome/browser/cancelable_request.h"
13 #include "chrome/browser/history/history_types.h" 13 #include "chrome/browser/history/history_types.h"
14 #include "chrome/browser/profiles/profile_keyed_service.h"
14 #include "chrome/common/ref_counted_util.h" 15 #include "chrome/common/ref_counted_util.h"
15 16
16 class GURL; 17 class GURL;
17 class Profile; 18 class Profile;
18 19
19 // The favicon service provides methods to access favicons. It calls the history 20 // The favicon service provides methods to access favicons. It calls the history
20 // backend behind the scenes. 21 // backend behind the scenes.
21 // 22 //
22 // This service is thread safe. Each request callback is invoked in the 23 // This service is thread safe. Each request callback is invoked in the
23 // thread that made the request. 24 // thread that made the request.
24 class FaviconService : public CancelableRequestProvider { 25 class FaviconService : public CancelableRequestProvider,
26 public ProfileKeyedService {
25 public: 27 public:
26 explicit FaviconService(Profile* profile); 28 explicit FaviconService(Profile* profile);
27 29
28 virtual ~FaviconService(); 30 virtual ~FaviconService();
29 31
30 // Callback for GetFavicon. If we have previously inquired about the favicon 32 // Callback for GetFavicon. If we have previously inquired about the favicon
31 // for this URL, |know_favicon| will be true, and the rest of the fields will 33 // for this URL, |know_favicon| will be true, and the rest of the fields will
32 // be valid (otherwise they will be ignored). 34 // be valid (otherwise they will be ignored).
33 // 35 //
34 // On |know_favicon| == true, |data| will either contain the PNG encoded 36 // On |know_favicon| == true, |data| will either contain the PNG encoded
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SetImportedFavicons( 100 void SetImportedFavicons(
99 const std::vector<history::ImportedFaviconUsage>& favicon_usage); 101 const std::vector<history::ImportedFaviconUsage>& favicon_usage);
100 102
101 // Sets the favicon for a page. 103 // Sets the favicon for a page.
102 void SetFavicon(const GURL& page_url, 104 void SetFavicon(const GURL& page_url,
103 const GURL& icon_url, 105 const GURL& icon_url,
104 const std::vector<unsigned char>& image_data, 106 const std::vector<unsigned char>& image_data,
105 history::IconType icon_type); 107 history::IconType icon_type);
106 108
107 private: 109 private:
108 Profile* profile_; 110 Profile* profile_;
andreip3000 2012/08/17 10:11:26 I think this dependency must go. You can just inje
rpetterson 2012/08/19 01:10:01 I think I've gotten rid of all the profile depende
109 111
110 // Helper to forward an empty result if we cannot get the history service. 112 // Helper to forward an empty result if we cannot get the history service.
111 void ForwardEmptyResultAsync(GetFaviconRequest* request); 113 void ForwardEmptyResultAsync(GetFaviconRequest* request);
112 114
113 DISALLOW_COPY_AND_ASSIGN(FaviconService); 115 DISALLOW_COPY_AND_ASSIGN(FaviconService);
114 }; 116 };
115 117
116 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 118 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_handler.cc ('k') | chrome/browser/favicon/favicon_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698