OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/views/create_application_shortcut_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 CreateApplicationShortcutView::~CreateApplicationShortcutView() { | 230 CreateApplicationShortcutView::~CreateApplicationShortcutView() { |
231 if (pending_download_) | 231 if (pending_download_) |
232 pending_download_->Cancel(); | 232 pending_download_->Cancel(); |
233 } | 233 } |
234 | 234 |
235 void CreateApplicationShortcutView::Init() { | 235 void CreateApplicationShortcutView::Init() { |
236 // Prepare data | 236 // Prepare data |
237 web_app::GetShortcutInfoForTab(tab_contents_, &shortcut_info_); | 237 web_app::GetShortcutInfoForTab(tab_contents_, &shortcut_info_); |
238 | 238 |
239 const webkit_glue::WebApplicationInfo& app_info = | 239 const WebApplicationInfo& app_info = tab_contents_->web_app_info(); |
240 tab_contents_->web_app_info(); | |
241 if (!app_info.icons.empty()) { | 240 if (!app_info.icons.empty()) { |
242 web_app::GetIconsInfo(app_info, &unprocessed_icons_); | 241 web_app::GetIconsInfo(app_info, &unprocessed_icons_); |
243 FetchIcon(); | 242 FetchIcon(); |
244 } | 243 } |
245 | 244 |
246 // Create controls | 245 // Create controls |
247 app_info_ = new AppInfoView(shortcut_info_.title, shortcut_info_.description, | 246 app_info_ = new AppInfoView(shortcut_info_.title, shortcut_info_.description, |
248 shortcut_info_.favicon); | 247 shortcut_info_.favicon); |
249 create_shortcuts_label_ = new views::Label( | 248 create_shortcuts_label_ = new views::Label( |
250 l10n_util::GetString(IDS_CREATE_SHORTCUTS_LABEL)); | 249 l10n_util::GetString(IDS_CREATE_SHORTCUTS_LABEL)); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 const SkBitmap& image) { | 448 const SkBitmap& image) { |
450 pending_download_ = NULL; | 449 pending_download_ = NULL; |
451 | 450 |
452 if (!errored && !image.isNull()) { | 451 if (!errored && !image.isNull()) { |
453 shortcut_info_.favicon = image; | 452 shortcut_info_.favicon = image; |
454 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 453 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
455 } else { | 454 } else { |
456 FetchIcon(); | 455 FetchIcon(); |
457 } | 456 } |
458 } | 457 } |
OLD | NEW |