Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 6672065: Support touch icon in FaviconHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error for clank mac and unit test memory leak Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (unprocessed_icons_.empty()) { 130 if (unprocessed_icons_.empty()) {
131 // No app icon. Just use the favicon from TabContents. 131 // No app icon. Just use the favicon from TabContents.
132 UpdateShortcuts(); 132 UpdateShortcuts();
133 return; 133 return;
134 } 134 }
135 135
136 tab_contents_->tab_contents()->favicon_helper().DownloadImage( 136 tab_contents_->tab_contents()->favicon_helper().DownloadImage(
137 unprocessed_icons_.back().url, 137 unprocessed_icons_.back().url,
138 std::max(unprocessed_icons_.back().width, 138 std::max(unprocessed_icons_.back().width,
139 unprocessed_icons_.back().height), 139 unprocessed_icons_.back().height),
140 history::FAVICON,
140 NewCallback(this, &UpdateShortcutWorker::OnIconDownloaded)); 141 NewCallback(this, &UpdateShortcutWorker::OnIconDownloaded));
141 unprocessed_icons_.pop_back(); 142 unprocessed_icons_.pop_back();
142 } 143 }
143 144
144 void UpdateShortcutWorker::OnIconDownloaded(int download_id, 145 void UpdateShortcutWorker::OnIconDownloaded(int download_id,
145 bool errored, 146 bool errored,
146 const SkBitmap& image) { 147 const SkBitmap& image) {
147 if (tab_contents_ == NULL) { 148 if (tab_contents_ == NULL) {
148 DeleteMe(); // We are done if underlying TabContents is gone. 149 DeleteMe(); // We are done if underlying TabContents is gone.
149 return; 150 return;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 309
309 void UpdateShortcutForTabContents(TabContentsWrapper* tab_contents) { 310 void UpdateShortcutForTabContents(TabContentsWrapper* tab_contents) {
310 #if defined(OS_WIN) 311 #if defined(OS_WIN)
311 // UpdateShortcutWorker will delete itself when it's done. 312 // UpdateShortcutWorker will delete itself when it's done.
312 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); 313 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents);
313 worker->Run(); 314 worker->Run();
314 #endif // defined(OS_WIN) 315 #endif // defined(OS_WIN)
315 } 316 }
316 317
317 } // namespace web_app 318 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/create_application_shortcut_view.cc ('k') | chrome/browser/ui/webui/most_visited_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698