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

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.cc

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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) 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.cc ('k') | chrome/browser/ui/views/critical_notification_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698