| 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/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 | 426 |
| 427 bool CreateUrlApplicationShortcutView::Accept() { | 427 bool CreateUrlApplicationShortcutView::Accept() { |
| 428 if (!CreateApplicationShortcutView::Accept()) | 428 if (!CreateApplicationShortcutView::Accept()) |
| 429 return false; | 429 return false; |
| 430 | 430 |
| 431 extensions::TabHelper::FromWebContents(web_contents_)-> | 431 extensions::TabHelper::FromWebContents(web_contents_)-> |
| 432 SetAppIcon(shortcut_info_.favicon.IsEmpty() | 432 SetAppIcon(shortcut_info_.favicon.IsEmpty() |
| 433 ? SkBitmap() | 433 ? SkBitmap() |
| 434 : *shortcut_info_.favicon.ToSkBitmap()); | 434 : *shortcut_info_.favicon.ToSkBitmap()); |
| 435 Browser* browser = browser::FindBrowserWithWebContents(web_contents_); | 435 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
| 436 if (browser) | 436 if (browser) |
| 437 chrome::ConvertTabToAppWindow(browser, web_contents_); | 437 chrome::ConvertTabToAppWindow(browser, web_contents_); |
| 438 return true; | 438 return true; |
| 439 } | 439 } |
| 440 | 440 |
| 441 void CreateUrlApplicationShortcutView::FetchIcon() { | 441 void CreateUrlApplicationShortcutView::FetchIcon() { |
| 442 // There should only be fetch job at a time. | 442 // There should only be fetch job at a time. |
| 443 DCHECK_EQ(-1, pending_download_id_); | 443 DCHECK_EQ(-1, pending_download_id_); |
| 444 | 444 |
| 445 if (unprocessed_icons_.empty()) // No icons to fetch. | 445 if (unprocessed_icons_.empty()) // No icons to fetch. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 if (image.IsEmpty()) { | 536 if (image.IsEmpty()) { |
| 537 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). | 537 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). |
| 538 GetImageNamed(IDR_APP_DEFAULT_ICON); | 538 GetImageNamed(IDR_APP_DEFAULT_ICON); |
| 539 } else { | 539 } else { |
| 540 shortcut_info_.favicon = image; | 540 shortcut_info_.favicon = image; |
| 541 } | 541 } |
| 542 | 542 |
| 543 CHECK(app_info_); | 543 CHECK(app_info_); |
| 544 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 544 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 545 } | 545 } |
| OLD | NEW |