| 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/browser/favicon/favicon_handler.h" | 5 #include "chrome/browser/favicon/favicon_handler.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 17 #include "chrome/browser/favicon/favicon_service_factory.h" | 17 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 18 #include "chrome/browser/favicon/favicon_util.h" | 18 #include "chrome/browser/favicon/favicon_util.h" |
| 19 #include "chrome/browser/history/select_favicon_frames.h" | 19 #include "chrome/browser/history/select_favicon_frames.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/common/icon_messages.h" | |
| 22 #include "content/public/browser/favicon_status.h" | 21 #include "content/public/browser/favicon_status.h" |
| 23 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
| 24 #include "skia/ext/image_operations.h" | 23 #include "skia/ext/image_operations.h" |
| 25 #include "ui/gfx/codec/png_codec.h" | 24 #include "ui/gfx/codec/png_codec.h" |
| 26 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
| 27 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
| 28 #include "ui/gfx/image/image_util.h" | 27 #include "ui/gfx/image/image_util.h" |
| 29 | 28 |
| 29 using content::FaviconURL; |
| 30 using content::NavigationEntry; | 30 using content::NavigationEntry; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // Returns history::IconType the given icon_type corresponds to. | 34 // Returns history::IconType the given icon_type corresponds to. |
| 35 history::IconType ToHistoryIconType(FaviconURL::IconType icon_type) { | 35 history::IconType ToHistoryIconType(FaviconURL::IconType icon_type) { |
| 36 switch (icon_type) { | 36 switch (icon_type) { |
| 37 case FaviconURL::FAVICON: | 37 case FaviconURL::FAVICON: |
| 38 return history::FAVICON; | 38 return history::FAVICON; |
| 39 case FaviconURL::TOUCH_ICON: | 39 case FaviconURL::TOUCH_ICON: |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 const int download_id = DownloadFavicon(image_url, image_size); | 608 const int download_id = DownloadFavicon(image_url, image_size); |
| 609 if (download_id) { | 609 if (download_id) { |
| 610 // Download ids should be unique. | 610 // Download ids should be unique. |
| 611 DCHECK(download_requests_.find(download_id) == download_requests_.end()); | 611 DCHECK(download_requests_.find(download_id) == download_requests_.end()); |
| 612 download_requests_[download_id] = | 612 download_requests_[download_id] = |
| 613 DownloadRequest(url, image_url, icon_type); | 613 DownloadRequest(url, image_url, icon_type); |
| 614 } | 614 } |
| 615 | 615 |
| 616 return download_id; | 616 return download_id; |
| 617 } | 617 } |
| OLD | NEW |