OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_RENDERER_FAVICON_HELPER_H_ | 5 #ifndef CONTENT_RENDERER_FAVICON_HELPER_H_ |
6 #define CONTENT_RENDERER_FAVICON_HELPER_H_ | 6 #define CONTENT_RENDERER_FAVICON_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "content/public/common/content_constants.h" | |
13 #include "content/public/renderer/render_view_observer.h" | 14 #include "content/public/renderer/render_view_observer.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 class SkBitmap; | 17 class SkBitmap; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 struct FaviconURL; | 20 struct FaviconURL; |
20 } | 21 } |
21 | 22 |
22 namespace webkit_glue { | 23 namespace webkit_glue { |
(...skipping 11 matching lines...) Expand all Loading... | |
34 explicit FaviconHelper(RenderView* render_view); | 35 explicit FaviconHelper(RenderView* render_view); |
35 | 36 |
36 // Sund a message that the favicon has changed. | 37 // Sund a message that the favicon has changed. |
37 void DidChangeIcon(WebKit::WebFrame* frame, | 38 void DidChangeIcon(WebKit::WebFrame* frame, |
38 WebKit::WebIconURL::Type icon_type); | 39 WebKit::WebIconURL::Type icon_type); |
39 | 40 |
40 private: | 41 private: |
41 virtual ~FaviconHelper(); | 42 virtual ~FaviconHelper(); |
42 | 43 |
43 // Message handler. | 44 // Message handler. |
44 void OnDownloadFavicon(int id, const GURL& image_url, int image_size); | 45 void OnDownloadFavicon(int id, |
46 const GURL& image_url, | |
47 bool is_favicon, | |
48 int image_size); | |
45 | 49 |
46 // Requests to download a favicon image. When done, the RenderView | 50 // Requests to download a favicon image. When done, the RenderView |
47 // is notified by way of DidDownloadFavicon. Returns true if the | 51 // is notified by way of DidDownloadFavicon. Returns true if the |
48 // request was successfully started, false otherwise. id is used to | 52 // request was successfully started, false otherwise. id is used to |
49 // uniquely identify the request and passed back to the | 53 // uniquely identify the request and passed back to the |
50 // DidDownloadFavicon method. If the image has multiple frames, the | 54 // DidDownloadFavicon method. If the image is a favicon, cookies are |
55 // not send and not accepted during download. | |
jam
2013/03/20 02:44:42
nit: s/send/sent
| |
56 // If the image has multiple frames, the | |
51 // frame whose size is image_size is returned. If the image doesn't | 57 // frame whose size is image_size is returned. If the image doesn't |
52 // have a frame at the specified size, the first is returned. | 58 // have a frame at the specified size, the first is returned. |
53 bool DownloadFavicon(int id, const GURL& image_url, int image_size); | 59 bool DownloadFavicon(int id, |
60 const GURL& image_url, | |
61 bool is_favicon, | |
62 int image_size); | |
54 | 63 |
55 // This callback is triggered when DownloadFavicon completes, either | 64 // This callback is triggered when DownloadFavicon completes, either |
56 // succesfully or with a failure. See DownloadFavicon for more | 65 // succesfully or with a failure. See DownloadFavicon for more |
57 // details. | 66 // details. |
58 void DidDownloadFavicon( | 67 void DidDownloadFavicon( |
59 int requested_size, | 68 int requested_size, |
60 webkit_glue::MultiResolutionImageResourceFetcher* fetcher, | 69 webkit_glue::MultiResolutionImageResourceFetcher* fetcher, |
61 const std::vector<SkBitmap>& images); | 70 const std::vector<SkBitmap>& images); |
62 | 71 |
63 // Decodes a data: URL image or returns an empty image in case of failure. | 72 // Decodes a data: URL image or returns an empty image in case of failure. |
(...skipping 13 matching lines...) Expand all Loading... | |
77 | 86 |
78 // ImageResourceFetchers schedule via DownloadImage. | 87 // ImageResourceFetchers schedule via DownloadImage. |
79 ImageResourceFetcherList image_fetchers_; | 88 ImageResourceFetcherList image_fetchers_; |
80 | 89 |
81 DISALLOW_COPY_AND_ASSIGN(FaviconHelper); | 90 DISALLOW_COPY_AND_ASSIGN(FaviconHelper); |
82 }; | 91 }; |
83 | 92 |
84 } // namespace content | 93 } // namespace content |
85 | 94 |
86 #endif // CONTENT_RENDERER_FAVICON_HELPER_H_ | 95 #endif // CONTENT_RENDERER_FAVICON_HELPER_H_ |
OLD | NEW |