| OLD | NEW |
| 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_UI_WEBUI_FAVICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 enum IconType { | 61 enum IconType { |
| 62 FAVICON, | 62 FAVICON, |
| 63 // Any available icon in the priority of TOUCH_ICON_PRECOMPOSED, TOUCH_ICON, | 63 // Any available icon in the priority of TOUCH_ICON_PRECOMPOSED, TOUCH_ICON, |
| 64 // FAVICON, and default favicon. | 64 // FAVICON, and default favicon. |
| 65 ANY | 65 ANY |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // |type| is the type of icon this FaviconSource will provide. | 68 // |type| is the type of icon this FaviconSource will provide. |
| 69 FaviconSource(Profile* profile, IconType type); | 69 FaviconSource(Profile* profile, IconType type); |
| 70 | 70 |
| 71 virtual ~FaviconSource(); | 71 ~FaviconSource() override; |
| 72 | 72 |
| 73 // content::URLDataSource implementation. | 73 // content::URLDataSource implementation. |
| 74 virtual std::string GetSource() const override; | 74 std::string GetSource() const override; |
| 75 virtual void StartDataRequest( | 75 void StartDataRequest( |
| 76 const std::string& path, | 76 const std::string& path, |
| 77 int render_process_id, | 77 int render_process_id, |
| 78 int render_frame_id, | 78 int render_frame_id, |
| 79 const content::URLDataSource::GotDataCallback& callback) override; | 79 const content::URLDataSource::GotDataCallback& callback) override; |
| 80 virtual std::string GetMimeType(const std::string&) const override; | 80 std::string GetMimeType(const std::string&) const override; |
| 81 virtual bool ShouldReplaceExistingSource() const override; | 81 bool ShouldReplaceExistingSource() const override; |
| 82 virtual bool ShouldServiceRequest( | 82 bool ShouldServiceRequest(const net::URLRequest* request) const override; |
| 83 const net::URLRequest* request) const override; | |
| 84 | 83 |
| 85 protected: | 84 protected: |
| 86 struct IconRequest { | 85 struct IconRequest { |
| 87 IconRequest(); | 86 IconRequest(); |
| 88 IconRequest(const content::URLDataSource::GotDataCallback& cb, | 87 IconRequest(const content::URLDataSource::GotDataCallback& cb, |
| 89 const GURL& path, | 88 const GURL& path, |
| 90 int size, | 89 int size, |
| 91 float scale); | 90 float scale); |
| 92 ~IconRequest(); | 91 ~IconRequest(); |
| 93 | 92 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // database doesn't have a favicon for a webpage. Indexed by IconSize values. | 134 // database doesn't have a favicon for a webpage. Indexed by IconSize values. |
| 136 scoped_refptr<base::RefCountedMemory> default_favicons_[NUM_SIZES]; | 135 scoped_refptr<base::RefCountedMemory> default_favicons_[NUM_SIZES]; |
| 137 | 136 |
| 138 // The favicon_base::IconTypes of icon that this FaviconSource handles. | 137 // The favicon_base::IconTypes of icon that this FaviconSource handles. |
| 139 int icon_types_; | 138 int icon_types_; |
| 140 | 139 |
| 141 DISALLOW_COPY_AND_ASSIGN(FaviconSource); | 140 DISALLOW_COPY_AND_ASSIGN(FaviconSource); |
| 142 }; | 141 }; |
| 143 | 142 |
| 144 #endif // CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_ | 143 #endif // CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_ |
| OLD | NEW |