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 #include "chrome/renderer/favicon_helper.h" | 5 #include "chrome/renderer/favicon_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
10 #include "chrome/common/favicon_url.h" | |
11 #include "chrome/common/icon_messages.h" | 10 #include "chrome/common/icon_messages.h" |
| 11 #include "content/public/common/favicon_url.h" |
12 #include "content/public/renderer/render_view.h" | 12 #include "content/public/renderer/render_view.h" |
13 #include "net/base/data_url.h" | 13 #include "net/base/data_url.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | |
18 #include "ui/gfx/favicon_size.h" | 18 #include "ui/gfx/favicon_size.h" |
19 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
20 #include "ui/gfx/skbitmap_operations.h" | 20 #include "ui/gfx/skbitmap_operations.h" |
21 #include "webkit/glue/image_decoder.h" | 21 #include "webkit/glue/image_decoder.h" |
22 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" | 22 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" |
23 #include "webkit/glue/webkit_glue.h" | 23 #include "webkit/glue/webkit_glue.h" |
24 | 24 |
| 25 using content::FaviconURL; |
25 using WebKit::WebFrame; | 26 using WebKit::WebFrame; |
26 using WebKit::WebIconURL; | 27 using WebKit::WebIconURL; |
27 using WebKit::WebVector; | 28 using WebKit::WebVector; |
28 using WebKit::WebURL; | 29 using WebKit::WebURL; |
29 using WebKit::WebURLRequest; | 30 using WebKit::WebURLRequest; |
30 using webkit_glue::MultiResolutionImageResourceFetcher; | 31 using webkit_glue::MultiResolutionImageResourceFetcher; |
31 | 32 |
32 static FaviconURL::IconType ToFaviconType(WebIconURL::Type type) { | 33 static FaviconURL::IconType ToFaviconType(WebIconURL::Type type) { |
33 switch (type) { | 34 switch (type) { |
34 case WebIconURL::TypeFavicon: | 35 case WebIconURL::TypeFavicon: |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return; | 164 return; |
164 | 165 |
165 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); | 166 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); |
166 std::vector<FaviconURL> urls; | 167 std::vector<FaviconURL> urls; |
167 for (size_t i = 0; i < icon_urls.size(); i++) { | 168 for (size_t i = 0; i < icon_urls.size(); i++) { |
168 urls.push_back(FaviconURL(icon_urls[i].iconURL(), | 169 urls.push_back(FaviconURL(icon_urls[i].iconURL(), |
169 ToFaviconType(icon_urls[i].iconType()))); | 170 ToFaviconType(icon_urls[i].iconType()))); |
170 } | 171 } |
171 SendUpdateFaviconURL(routing_id(), render_view()->GetPageId(), urls); | 172 SendUpdateFaviconURL(routing_id(), render_view()->GetPageId(), urls); |
172 } | 173 } |
OLD | NEW |