| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void AppInfoView::UpdateText(const string16& title, | 154 void AppInfoView::UpdateText(const string16& title, |
| 155 const string16& description) { | 155 const string16& description) { |
| 156 title_->SetText(title); | 156 title_->SetText(title); |
| 157 PrepareDescriptionLabel(description); | 157 PrepareDescriptionLabel(description); |
| 158 | 158 |
| 159 SetupLayout(); | 159 SetupLayout(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void AppInfoView::UpdateIcon(const gfx::Image& image) { | 162 void AppInfoView::UpdateIcon(const gfx::Image& image) { |
| 163 if (!image.IsEmpty()) | 163 if (!image.IsEmpty()) |
| 164 icon_->SetImage(image.ToSkBitmap()); | 164 icon_->SetImage(image.ToImageSkia()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void AppInfoView::OnPaint(gfx::Canvas* canvas) { | 167 void AppInfoView::OnPaint(gfx::Canvas* canvas) { |
| 168 gfx::Rect bounds = GetLocalBounds(); | 168 gfx::Rect bounds = GetLocalBounds(); |
| 169 | 169 |
| 170 SkRect border_rect = { | 170 SkRect border_rect = { |
| 171 SkIntToScalar(bounds.x()), | 171 SkIntToScalar(bounds.x()), |
| 172 SkIntToScalar(bounds.y()), | 172 SkIntToScalar(bounds.y()), |
| 173 SkIntToScalar(bounds.right()), | 173 SkIntToScalar(bounds.right()), |
| 174 SkIntToScalar(bounds.bottom()) | 174 SkIntToScalar(bounds.bottom()) |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 if (image.IsEmpty()) { | 534 if (image.IsEmpty()) { |
| 535 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). | 535 shortcut_info_.favicon = ui::ResourceBundle::GetSharedInstance(). |
| 536 GetImageNamed(IDR_APP_DEFAULT_ICON); | 536 GetImageNamed(IDR_APP_DEFAULT_ICON); |
| 537 } else { | 537 } else { |
| 538 shortcut_info_.favicon = image; | 538 shortcut_info_.favicon = image; |
| 539 } | 539 } |
| 540 | 540 |
| 541 CHECK(app_info_); | 541 CHECK(app_info_); |
| 542 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 542 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 543 } | 543 } |
| OLD | NEW |