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

Unified Diff: chrome/browser/media/tab_desktop_media_list.cc

Issue 1990053002: Desktop Capture Picker New UI: Non Mac Appearance Change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixes Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/media/tab_desktop_media_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e9ddebe2b8b1a8c9cc0f88f2b6248f24d8fa53cf 100644
--- a/chrome/browser/media/tab_desktop_media_list.cc
+++ b/chrome/browser/media/tab_desktop_media_list.cc
@@ -33,34 +33,16 @@ 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);
+ canvas.clear(SK_ColorTRANSPARENT);
// 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);
- fill_size = media::ScaleSizeToFitWithinTarget(favicon.size(), target_size);
- }
+ if (result.width() < favicon.width() || result.height() < favicon.height())
+ fill_size = media::ScaleSizeToFitWithinTarget(favicon.size(), size);
+
gfx::Rect center_rect(result.width(), result.height());
center_rect.ClampToCenteredSize(fill_size);
SkRect dest_rect =
@@ -122,13 +104,10 @@ void TabDesktopMediaList::Refresh() {
content::WebContentsMediaCaptureId(main_frame->GetProcess()->GetID(),
main_frame->GetRoutingID()));
- // Create display tab title.
- const base::string16 title = l10n_util::GetStringFUTF16(
- IDS_DESKTOP_MEDIA_PICKER_CHROME_TAB_TITLE, contents->GetTitle());
-
// Get tab's last active time stamp.
const base::TimeTicks t = contents->GetLastActiveTime();
- tab_map.insert(std::make_pair(t, SourceDescription(media_id, title)));
+ tab_map.insert(
+ std::make_pair(t, SourceDescription(media_id, contents->GetTitle())));
// Get favicon for tab.
favicon::FaviconDriver* favicon_driver =
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/media/tab_desktop_media_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698