OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_FAVICON_DOWNLOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_FAVICON_DOWNLOADER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_FAVICON_DOWNLOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_FAVICON_DOWNLOADER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 int http_status_code, | 62 int http_status_code, |
63 const GURL& image_url, | 63 const GURL& image_url, |
64 const std::vector<SkBitmap>& bitmaps, | 64 const std::vector<SkBitmap>& bitmaps, |
65 const std::vector<gfx::Size>& original_bitmap_sizes); | 65 const std::vector<gfx::Size>& original_bitmap_sizes); |
66 | 66 |
67 // content::WebContentsObserver overrides: | 67 // content::WebContentsObserver overrides: |
68 virtual void DidNavigateMainFrame( | 68 virtual void DidNavigateMainFrame( |
69 const content::LoadCommittedDetails& details, | 69 const content::LoadCommittedDetails& details, |
70 const content::FrameNavigateParams& params) OVERRIDE; | 70 const content::FrameNavigateParams& params) OVERRIDE; |
71 virtual void DidUpdateFaviconURL( | 71 virtual void DidUpdateFaviconURL( |
72 int32 page_id, | |
73 const std::vector<content::FaviconURL>& candidates) OVERRIDE; | 72 const std::vector<content::FaviconURL>& candidates) OVERRIDE; |
74 | 73 |
75 // Whether we have received favicons from the renderer. | 74 // Whether we have received favicons from the renderer. |
76 bool got_favicon_urls_; | 75 bool got_favicon_urls_; |
77 | 76 |
78 // URLs that aren't given by WebContentsObserver::DidUpdateFaviconURL() that | 77 // URLs that aren't given by WebContentsObserver::DidUpdateFaviconURL() that |
79 // should be used for this favicon. This is necessary in order to get touch | 78 // should be used for this favicon. This is necessary in order to get touch |
80 // icons on non-android environments. | 79 // icons on non-android environments. |
81 std::vector<GURL> extra_favicon_urls_; | 80 std::vector<GURL> extra_favicon_urls_; |
82 | 81 |
83 // The icons which were downloaded. Populated by FetchIcons(). | 82 // The icons which were downloaded. Populated by FetchIcons(). |
84 FaviconMap favicon_map_; | 83 FaviconMap favicon_map_; |
85 | 84 |
86 // Request ids of in-progress requests. | 85 // Request ids of in-progress requests. |
87 std::set<int> in_progress_requests_; | 86 std::set<int> in_progress_requests_; |
88 | 87 |
89 // Urls for which a download has already been initiated. Used to prevent | 88 // Urls for which a download has already been initiated. Used to prevent |
90 // duplicate downloads of the same url. | 89 // duplicate downloads of the same url. |
91 std::set<GURL> processed_urls_; | 90 std::set<GURL> processed_urls_; |
92 | 91 |
93 // Callback to run on favicon download completion. | 92 // Callback to run on favicon download completion. |
94 FaviconDownloaderCallback callback_; | 93 FaviconDownloaderCallback callback_; |
95 | 94 |
96 base::WeakPtrFactory<FaviconDownloader> weak_ptr_factory_; | 95 base::WeakPtrFactory<FaviconDownloader> weak_ptr_factory_; |
97 | 96 |
98 DISALLOW_COPY_AND_ASSIGN(FaviconDownloader); | 97 DISALLOW_COPY_AND_ASSIGN(FaviconDownloader); |
99 }; | 98 }; |
100 | 99 |
101 #endif // CHROME_BROWSER_EXTENSIONS_FAVICON_DOWNLOADER_H_ | 100 #endif // CHROME_BROWSER_EXTENSIONS_FAVICON_DOWNLOADER_H_ |
OLD | NEW |