Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ICON_DELEGATE_H__ | |
| 6 #define CHROME_BROWSER_ICON_DELEGATE_H__ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/history/history_types.h" | |
| 10 | |
| 11 class NavigationEntry; | |
| 12 | |
| 13 // IconDelegate is a interface should be implemented for a type of icon to | |
| 14 // handle to update the favicon data in NavigationEntry, provide the size for a | |
| 15 // type of icon or convert image to specific size. | |
| 16 class IconDelegate { | |
| 17 public: | |
| 18 IconDelegate() {} | |
| 19 virtual ~IconDelegate() {} | |
| 20 | |
| 21 // Updates the image data in NavigationEntry only if the image data is not | |
| 22 // valid and the given url is same as the one in NavigationEntry's favicon | |
| 23 // status. | |
| 24 virtual void UpdateFaviconImageData(NavigationEntry* entry, | |
|
sky
2011/03/18 17:33:37
I was hoping a delegate interface would allow Favi
| |
| 25 const GURL& url, | |
| 26 scoped_refptr<RefCountedMemory> data) = 0; | |
| 27 | |
| 28 // Converts the image data to an SkBitmap and sets it on the NavigationEntry. | |
| 29 // If the TabContents has a delegate, it is notified of the new favicon | |
| 30 // (INVALIDATE_FAVICON). | |
| 31 virtual void UpdateFaviconImageData(NavigationEntry* entry, | |
| 32 scoped_refptr<RefCountedMemory> data); | |
| 33 | |
| 34 virtual void UpdateFaviconImageData(NavigationEntry* entry, | |
| 35 const SkBitmap& image) = 0; | |
| 36 | |
| 37 // Updates the favicon url in NavigationEntry's favicon with the given url. | |
| 38 virtual void UpdateFaviconURL(NavigationEntry* entry, const GURL& url) = 0; | |
| 39 | |
| 40 // Converts downloaded icon before save to history DB and update to | |
| 41 // NavigationEntry. | |
| 42 virtual SkBitmap ConvertToFaviconSize(const SkBitmap& image) = 0; | |
| 43 | |
| 44 // Returns the preferred icon size. | |
| 45 virtual int GetIconSize() = 0; | |
| 46 | |
| 47 private: | |
| 48 DISALLOW_COPY_AND_ASSIGN(IconDelegate); | |
| 49 }; | |
| 50 | |
| 51 #endif // CHROME_BROWSER_ICON_DELEGATE_H__ | |
| OLD | NEW |