Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LARGE_ICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/task/cancelable_task_tracker.h" | 11 #include "base/task/cancelable_task_tracker.h" |
| 12 #include "components/favicon/core/fallback_icon_service.h" | 12 #include "components/favicon/core/fallback_icon_service.h" |
| 13 #include "content/public/browser/url_data_source.h" | 13 #include "content/public/browser/url_data_source.h" |
| 14 | 14 |
| 15 namespace favicon { | 15 namespace favicon { |
| 16 class FallbackIconService; | 16 class FallbackIconService; |
| 17 class LargeIconService; | 17 class LargeIconService; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace favicon_base { | 20 namespace favicon_base { |
| 21 struct LargeIconResult; | 21 struct LargeIconResult; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // LargeIconSource services explicit chrome:// requests for large icons. | 24 // LargeIconSource services explicit chrome:// requests for large icons. |
| 25 // | 25 // |
| 26 // Format: | 26 // Format: |
| 27 // chrome://large-icon/size/url | 27 // chrome://large-icon/size/url |
| 28 // or | |
| 29 // chrome://large-icon/size/fallback/fallback_params/url | |
| 28 // | 30 // |
| 29 // Parameter: | 31 // Parameter: |
| 30 // 'size' Required (including trailing '/') | 32 // 'size' Required (including trailing '/') |
| 31 // Positive integer to specify the large icon's size in pixels. | 33 // Positive integer to specify the large icon's size in pixels. |
| 34 // fallback_params Optional | |
| 35 // 5 comma-separated parameters of fallback icon in the format described at | |
| 36 // the top of the file "chrome/browser/ui/webui/fallback_icon_source.h". | |
| 32 // 'url' Optional | 37 // 'url' Optional |
| 33 // String to specify the page URL of the large icon. | 38 // String to specify the page URL of the large icon. |
| 34 // | 39 // |
| 35 // Example: chrome://large-icon/48/http://www.google.com/ | 40 // Examples: |
| 36 // This requests a 48x48 large icon for http://www.google.com. | 41 // chrome://large-icon/48/http://www.google.com/ |
| 42 // This requests a 48x48 large icon for http://www.google.com. | |
| 43 // chrome://large-icon/16/fallback/,777,FFF,0.625,0.4/http://example.com | |
|
Evan Stade
2015/10/15 23:46:32
I don't think you should be passing this fallback
kolos1
2015/10/16 14:19:25
Thanks. That is very interesting idea, but what if
| |
| 44 // If there is no icon for example.com, the style of fallback icon will be | |
| 45 // specified with listed parameters. | |
| 37 class LargeIconSource : public content::URLDataSource { | 46 class LargeIconSource : public content::URLDataSource { |
| 38 public: | 47 public: |
| 39 // |fallback_icon_service| and |large_icon_service| are owned by caller and | 48 // |fallback_icon_service| and |large_icon_service| are owned by caller and |
| 40 // may be null. | 49 // may be null. |
| 41 LargeIconSource(favicon::FallbackIconService* fallback_icon_service, | 50 LargeIconSource(favicon::FallbackIconService* fallback_icon_service, |
| 42 favicon::LargeIconService* large_icon_service); | 51 favicon::LargeIconService* large_icon_service); |
| 43 | 52 |
| 44 ~LargeIconSource() override; | 53 ~LargeIconSource() override; |
| 45 | 54 |
| 46 // content::URLDataSource implementation. | 55 // content::URLDataSource implementation. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 71 // Owned by client. | 80 // Owned by client. |
| 72 favicon::FallbackIconService* fallback_icon_service_; | 81 favicon::FallbackIconService* fallback_icon_service_; |
| 73 | 82 |
| 74 // Owned by client. | 83 // Owned by client. |
| 75 favicon::LargeIconService* large_icon_service_; | 84 favicon::LargeIconService* large_icon_service_; |
| 76 | 85 |
| 77 DISALLOW_COPY_AND_ASSIGN(LargeIconSource); | 86 DISALLOW_COPY_AND_ASSIGN(LargeIconSource); |
| 78 }; | 87 }; |
| 79 | 88 |
| 80 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ | 89 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ |
| OLD | NEW |