OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DOM_UI_FILEICON_SOURCE_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_FILEICON_SOURCE_H_ |
| 7 |
| 8 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 9 #include "chrome/browser/icon_manager.h" |
| 10 #include "chrome/common/resource_bundle.h" |
| 11 |
| 12 class GURL; |
| 13 |
| 14 // FileIconSource is the gateway between network-level chrome: |
| 15 // requests for favicons and the history backend that serves these. |
| 16 class FileIconSource : public ChromeURLDataManager::DataSource { |
| 17 public: |
| 18 explicit FileIconSource(); |
| 19 virtual ~FileIconSource(); |
| 20 |
| 21 // Called when the network layer has requested a resource underneath |
| 22 // the path we registered. |
| 23 virtual void StartDataRequest(const std::string& path, int request_id); |
| 24 |
| 25 virtual std::string GetMimeType(const std::string&) const { |
| 26 // Rely on image decoder inferring the correct type. |
| 27 return std::string(); |
| 28 } |
| 29 |
| 30 // Called when favicon data is available from the history backend. |
| 31 void OnFileIconDataAvailable( |
| 32 IconManager::Handle request_handle, |
| 33 SkBitmap* icon); |
| 34 |
| 35 private: |
| 36 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
| 37 |
| 38 // Raw PNG representation of the favicon to show when the favicon |
| 39 // database doesn't have a favicon for a webpage. |
| 40 scoped_refptr<RefCountedBytes> default_favicon_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(FileIconSource); |
| 43 }; |
| 44 #endif // CHROME_BROWSER_DOM_UI_FILEICON_SOURCE_H_ |
| 45 |
OLD | NEW |