Chromium Code Reviews| Index: chrome/browser/media/tab_desktop_media_list.cc |
| diff --git a/chrome/browser/media/tab_desktop_media_list.cc b/chrome/browser/media/tab_desktop_media_list.cc |
| index b6aa442b827f4c3cafd3573b21115365c578cfbb..d09f0ad4a327b31692235768b6d0d359092e79e5 100644 |
| --- a/chrome/browser/media/tab_desktop_media_list.cc |
| +++ b/chrome/browser/media/tab_desktop_media_list.cc |
| @@ -33,32 +33,18 @@ gfx::ImageSkia CreateEnclosedFaviconImage(gfx::Size size, |
| // Create a bitmap. |
| SkBitmap result; |
| - result.allocN32Pixels(size.width(), size.height(), true); |
| + result.allocN32Pixels(size.width(), size.height(), false); |
| SkCanvas canvas(result); |
| - // White background. |
| - canvas.drawARGB(255, 255, 255, 255); |
| - |
| - // Black border. |
| - const int thickness = 5; |
| - SkPaint paint; |
| - paint.setARGB(255, 0, 0, 0); |
| - paint.setStyle(SkPaint::kStroke_Style); |
| - paint.setStrokeWidth(thickness); |
| - canvas.drawRectCoords(thickness, // left |
| - thickness, // top |
| - result.width() - thickness, // right |
| - result.height() - thickness, // bottom |
| - paint); |
| + // Draw transparent background. |
| + const SkColor bg_color = 0; |
| + canvas.clear(bg_color); |
|
msw
2016/05/20 23:26:36
Just inline canvas.clear(SK_ColorTRANSPARENT), rem
qiangchen
2016/05/24 00:03:36
Done.
|
| // Draw the favicon image into the center of result image. If the favicon is |
| // too big, scale it down. |
| gfx::Size fill_size = favicon.size(); |
| - const double fraction = 0.75; |
| - if (result.width() * fraction < favicon.width() || |
| - result.height() * fraction < favicon.height()) { |
| - gfx::Size target_size(result.width() * fraction, |
| - result.height() * fraction); |
| + if (result.width() < favicon.width() || result.height() < favicon.height()) { |
| + gfx::Size target_size(result.width(), result.height()); |
|
msw
2016/05/20 23:26:36
optional nit: remove |target_size|, inline |size|
qiangchen
2016/05/24 00:03:36
Done.
|
| fill_size = media::ScaleSizeToFitWithinTarget(favicon.size(), target_size); |
| } |
| gfx::Rect center_rect(result.width(), result.height()); |
| @@ -123,8 +109,7 @@ void TabDesktopMediaList::Refresh() { |
| main_frame->GetRoutingID())); |
| // Create display tab title. |
| - const base::string16 title = l10n_util::GetStringFUTF16( |
| - IDS_DESKTOP_MEDIA_PICKER_CHROME_TAB_TITLE, contents->GetTitle()); |
|
msw
2016/05/20 23:26:35
Remove IDS_DESKTOP_MEDIA_PICKER_CHROME_TAB_TITLE i
qiangchen
2016/05/24 00:03:36
You are right. I thought Mac side still used it, b
|
| + const base::string16 title = contents->GetTitle(); |
|
msw
2016/05/20 23:26:36
optional nit: inline contents->GetTitle() below, r
qiangchen
2016/05/24 00:03:36
Done.
|
| // Get tab's last active time stamp. |
| const base::TimeTicks t = contents->GetLastActiveTime(); |