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/ui/ash/launcher/launcher_favicon_loader.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bitmap_.reset(); | 102 bitmap_.reset(); |
103 } | 103 } |
104 // Request any new urls. | 104 // Request any new urls. |
105 for (std::set<GURL>::iterator iter = urls.begin(); | 105 for (std::set<GURL>::iterator iter = urls.begin(); |
106 iter != urls.end(); ++iter) { | 106 iter != urls.end(); ++iter) { |
107 if (processed_requests_.find(*iter) != processed_requests_.end()) | 107 if (processed_requests_.find(*iter) != processed_requests_.end()) |
108 continue; // Skip already processed downloads. | 108 continue; // Skip already processed downloads. |
109 if (pending_requests_.find(*iter) != pending_requests_.end()) | 109 if (pending_requests_.find(*iter) != pending_requests_.end()) |
110 continue; // Skip already pending downloads. | 110 continue; // Skip already pending downloads. |
111 pending_requests_.insert(*iter); | 111 pending_requests_.insert(*iter); |
112 web_contents_->DownloadFavicon(*iter, 0, | 112 web_contents_->DownloadFavicon(*iter, true, 0, |
113 base::Bind(&FaviconBitmapHandler::DidDownloadFavicon, | 113 base::Bind(&FaviconBitmapHandler::DidDownloadFavicon, |
114 weak_ptr_factory_.GetWeakPtr())); | 114 weak_ptr_factory_.GetWeakPtr())); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 bool FaviconBitmapHandler::HasPendingDownloads() const { | 118 bool FaviconBitmapHandler::HasPendingDownloads() const { |
119 return !pending_requests_.empty(); | 119 return !pending_requests_.empty(); |
120 } | 120 } |
121 | 121 |
122 void FaviconBitmapHandler::DidDownloadFavicon( | 122 void FaviconBitmapHandler::DidDownloadFavicon( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 LauncherFaviconLoader::~LauncherFaviconLoader() { | 168 LauncherFaviconLoader::~LauncherFaviconLoader() { |
169 } | 169 } |
170 | 170 |
171 SkBitmap LauncherFaviconLoader::GetFavicon() const { | 171 SkBitmap LauncherFaviconLoader::GetFavicon() const { |
172 return favicon_handler_->bitmap(); | 172 return favicon_handler_->bitmap(); |
173 } | 173 } |
174 | 174 |
175 bool LauncherFaviconLoader::HasPendingDownloads() const { | 175 bool LauncherFaviconLoader::HasPendingDownloads() const { |
176 return favicon_handler_->HasPendingDownloads(); | 176 return favicon_handler_->HasPendingDownloads(); |
177 } | 177 } |
OLD | NEW |