| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView( | 486 CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView( |
| 487 Profile* profile, | 487 Profile* profile, |
| 488 const extensions::Extension* app) : | 488 const extensions::Extension* app) : |
| 489 CreateApplicationShortcutView(profile), | 489 CreateApplicationShortcutView(profile), |
| 490 app_(app), | 490 app_(app), |
| 491 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) { | 491 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) { |
| 492 shortcut_info_.extension_id = app_->id(); | 492 shortcut_info_.extension_id = app_->id(); |
| 493 shortcut_info_.url = GURL(app_->launch_web_url()); | 493 shortcut_info_.url = GURL(app_->launch_web_url()); |
| 494 shortcut_info_.title = UTF8ToUTF16(app_->name()); | 494 shortcut_info_.title = UTF8ToUTF16(app_->name()); |
| 495 shortcut_info_.description = UTF8ToUTF16(app_->description()); | 495 shortcut_info_.description = UTF8ToUTF16(app_->description()); |
| 496 shortcut_info_.is_platform_app = app_->is_platform_app(); | |
| 497 shortcut_info_.extension_path = app_->path(); | 496 shortcut_info_.extension_path = app_->path(); |
| 498 shortcut_info_.profile_path = profile->GetPath(); | 497 shortcut_info_.profile_path = profile->GetPath(); |
| 499 | 498 |
| 500 // The icon will be resized to |max_size|. | 499 // The icon will be resized to |max_size|. |
| 501 const gfx::Size max_size(kAppIconSize, kAppIconSize); | 500 const gfx::Size max_size(kAppIconSize, kAppIconSize); |
| 502 | 501 |
| 503 // Look for an icon. If there is no icon at the ideal size, | 502 // Look for an icon. If there is no icon at the ideal size, |
| 504 // we will resize whatever we can get. Making a large icon smaller | 503 // we will resize whatever we can get. Making a large icon smaller |
| 505 // is prefered to making a small icon larger, so look for a larger | 504 // is prefered to making a small icon larger, so look for a larger |
| 506 // icon first: | 505 // icon first: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 if (image.IsEmpty()) { | 537 if (image.IsEmpty()) { |
| 539 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). | 538 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). |
| 540 GetImageNamed(IDR_APP_DEFAULT_ICON); | 539 GetImageNamed(IDR_APP_DEFAULT_ICON); |
| 541 } else { | 540 } else { |
| 542 shortcut_info_.favicon = image; | 541 shortcut_info_.favicon = image; |
| 543 } | 542 } |
| 544 | 543 |
| 545 CHECK(app_info_); | 544 CHECK(app_info_); |
| 546 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 545 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 547 } | 546 } |
| OLD | NEW |