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/web_applications/web_app_ui.h" | 5 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 } | 165 } |
166 | 166 |
167 if (unprocessed_icons_.empty()) { | 167 if (unprocessed_icons_.empty()) { |
168 // No app icon. Just use the favicon from WebContents. | 168 // No app icon. Just use the favicon from WebContents. |
169 UpdateShortcuts(); | 169 UpdateShortcuts(); |
170 return; | 170 return; |
171 } | 171 } |
172 | 172 |
173 web_contents_->DownloadFavicon( | 173 web_contents_->DownloadFavicon( |
174 unprocessed_icons_.back().url, | 174 unprocessed_icons_.back().url, |
175 true, // favicon | |
jam
2013/03/20 02:44:42
nit: it seems if someone wants to see what this is
| |
175 std::max(unprocessed_icons_.back().width, | 176 std::max(unprocessed_icons_.back().width, |
176 unprocessed_icons_.back().height), | 177 unprocessed_icons_.back().height), |
177 base::Bind(&UpdateShortcutWorker::DidDownloadFavicon, | 178 base::Bind(&UpdateShortcutWorker::DidDownloadFavicon, |
178 base::Unretained(this))); | 179 base::Unretained(this))); |
179 unprocessed_icons_.pop_back(); | 180 unprocessed_icons_.pop_back(); |
180 } | 181 } |
181 | 182 |
182 void UpdateShortcutWorker::DidDownloadFavicon( | 183 void UpdateShortcutWorker::DidDownloadFavicon( |
183 int id, | 184 int id, |
184 const GURL& image_url, | 185 const GURL& image_url, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 } | 437 } |
437 | 438 |
438 // |info_list| may still be empty at this point, in which case LoadImage | 439 // |info_list| may still be empty at this point, in which case LoadImage |
439 // will call the OnImageLoaded callback with an empty image and exit | 440 // will call the OnImageLoaded callback with an empty image and exit |
440 // immediately. | 441 // immediately. |
441 extensions::ImageLoader::Get(profile)->LoadImagesAsync(&extension, info_list, | 442 extensions::ImageLoader::Get(profile)->LoadImagesAsync(&extension, info_list, |
442 base::Bind(&OnImageLoaded, shortcut_info, callback)); | 443 base::Bind(&OnImageLoaded, shortcut_info, callback)); |
443 } | 444 } |
444 | 445 |
445 } // namespace web_app | 446 } // namespace web_app |
OLD | NEW |