OLD | NEW |
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 #ifndef CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ |
6 #define CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ | 6 #define CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 explicit WebUIFavIconSource(Profile* profile); | 23 explicit WebUIFavIconSource(Profile* profile); |
24 | 24 |
25 // Called when the network layer has requested a resource underneath | 25 // Called when the network layer has requested a resource underneath |
26 // the path we registered. | 26 // the path we registered. |
27 virtual void StartDataRequest(const std::string& path, | 27 virtual void StartDataRequest(const std::string& path, |
28 bool is_off_the_record, | 28 bool is_off_the_record, |
29 int request_id); | 29 int request_id); |
30 | 30 |
31 virtual std::string GetMimeType(const std::string&) const; | 31 virtual std::string GetMimeType(const std::string&) const; |
32 | 32 |
| 33 virtual bool ShouldReplaceExistingSource() const; |
| 34 |
| 35 private: |
33 // Called when favicon data is available from the history backend. | 36 // Called when favicon data is available from the history backend. |
34 void OnFavIconDataAvailable(FaviconService::Handle request_handle, | 37 void OnFavIconDataAvailable(FaviconService::Handle request_handle, |
35 bool know_favicon, | 38 bool know_favicon, |
36 scoped_refptr<RefCountedMemory> data, | 39 scoped_refptr<RefCountedMemory> data, |
37 bool expired, | 40 bool expired, |
38 GURL url); | 41 GURL url); |
39 | 42 |
40 private: | |
41 // Sends the default favicon. | 43 // Sends the default favicon. |
42 void SendDefaultResponse(int request_id); | 44 void SendDefaultResponse(int request_id); |
43 | 45 |
44 virtual ~WebUIFavIconSource(); | 46 virtual ~WebUIFavIconSource(); |
45 | 47 |
46 Profile* profile_; | 48 Profile* profile_; |
47 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 49 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
48 | 50 |
49 // Raw PNG representation of the favicon to show when the favicon | 51 // Raw PNG representation of the favicon to show when the favicon |
50 // database doesn't have a favicon for a webpage. | 52 // database doesn't have a favicon for a webpage. |
51 scoped_refptr<RefCountedMemory> default_favicon_; | 53 scoped_refptr<RefCountedMemory> default_favicon_; |
52 | 54 |
53 DISALLOW_COPY_AND_ASSIGN(WebUIFavIconSource); | 55 DISALLOW_COPY_AND_ASSIGN(WebUIFavIconSource); |
54 }; | 56 }; |
55 | 57 |
56 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ | 58 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_FAVICON_SOURCE_H_ |
OLD | NEW |