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

Unified Diff: chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.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: Comments Resolved 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
Index: chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
index fbc8f56a2f4be05b77fa0aa65cc4bb578a370e33..310776df8fc434bd3ba63afa164ff397cc317862 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -75,13 +75,34 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView(
if (screen_list) {
source_types_.push_back(DesktopMediaID::TYPE_SCREEN);
+ const DesktopMediaSourceViewStyle kSingleScreenStyle(
+ 1, // columns
+ gfx::Size(360, 280), // item_size
+ gfx::Rect(0, 0, 0, 0), // label_rect
+ gfx::HorizontalAlignment::ALIGN_CENTER, // text_alignment
+ gfx::Rect(20, 20, 320, 240), // image_rect
+ 4, // selection_border_thickness
+ 5); // focus_rectangle_inset
+
+ const DesktopMediaSourceViewStyle kGenericScreenStyle(
+ 2, // columns
+ gfx::Size(270, 220), // item_size
+ gfx::Rect(15, 165, 240, 40), // label_rect
+ gfx::HorizontalAlignment::ALIGN_CENTER, // text_alignment
+ gfx::Rect(15, 15, 240, 150), // image_rect
+ 2, // selection_border_thickness
+ 5); // focus_rectangle_inset
+
views::ScrollView* screen_scroll_view =
views::ScrollView::CreateScrollViewWithBorder();
- list_views_.push_back(
- new DesktopMediaListView(this, std::move(screen_list)));
+ list_views_.push_back(new DesktopMediaListView(
+ this, std::move(screen_list), kGenericScreenStyle, kSingleScreenStyle));
screen_scroll_view->SetContents(list_views_.back());
- screen_scroll_view->ClipHeightTo(kListItemHeight, kListItemHeight * 2);
+ screen_scroll_view->ClipHeightTo(
+ kGenericScreenStyle.item_size.height(),
+ kGenericScreenStyle.item_size.height() * 2);
+
pane_->AddTab(
l10n_util::GetStringUTF16(IDS_DESKTOP_MEDIA_PICKER_SOURCE_TYPE_SCREEN),
screen_scroll_view);
@@ -90,13 +111,23 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView(
if (window_list) {
source_types_.push_back(DesktopMediaID::TYPE_WINDOW);
+
+ const DesktopMediaSourceViewStyle kWindowStyle(
+ 3, // columns
+ gfx::Size(180, 160), // item_size
+ gfx::Rect(10, 110, 160, 40), // label_rect
+ gfx::HorizontalAlignment::ALIGN_CENTER, // text_alignment
+ gfx::Rect(8, 8, 164, 104), // image_rect
+ 2, // selection_border_thickness
+ 5); // focus_rectangle_inset
+
views::ScrollView* window_scroll_view =
views::ScrollView::CreateScrollViewWithBorder();
- list_views_.push_back(
- new DesktopMediaListView(this, std::move(window_list)));
-
+ list_views_.push_back(new DesktopMediaListView(this, std::move(window_list),
msw 2016/05/24 18:54:25 nit: format like lines 152/153?
qiangchen 2016/05/25 16:24:08 Done.
+ kWindowStyle));
window_scroll_view->SetContents(list_views_.back());
- window_scroll_view->ClipHeightTo(kListItemHeight, kListItemHeight * 2);
+ window_scroll_view->ClipHeightTo(kWindowStyle.item_size.height(),
+ kWindowStyle.item_size.height() * 2);
pane_->AddTab(
l10n_util::GetStringUTF16(IDS_DESKTOP_MEDIA_PICKER_SOURCE_TYPE_WINDOW),
@@ -106,12 +137,29 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView(
if (tab_list) {
source_types_.push_back(DesktopMediaID::TYPE_WEB_CONTENTS);
+
+ const DesktopMediaSourceViewStyle kTabStyle(
+ 1, // columns
+ gfx::Size(600, 30), // item_size
+ gfx::Rect(46, 0, 490, 30), // label_rect
+ gfx::HorizontalAlignment::ALIGN_LEFT, // text_alignment
+ gfx::Rect(10, 2, 26, 26), // image_rect
+ 1, // selection_border_thickness
+ 0); // focus_rectangle_inset
+
views::ScrollView* tab_scroll_view =
views::ScrollView::CreateScrollViewWithBorder();
- list_views_.push_back(new DesktopMediaListView(this, std::move(tab_list)));
+ list_views_.push_back(
+ new DesktopMediaListView(this, std::move(tab_list), kTabStyle));
tab_scroll_view->SetContents(list_views_.back());
- tab_scroll_view->ClipHeightTo(kListItemHeight, kListItemHeight * 2);
+ tab_scroll_view->ClipHeightTo(kTabStyle.item_size.height(),
+ kTabStyle.item_size.height() * 2);
+
+ // We want the hover shade to be the full row.
+ // Thus we make the DesktopMediaSourceView to horizontally overflow.
msw 2016/05/24 18:54:25 Can you avoid overflow by just setting the width o
qiangchen 2016/05/25 16:24:08 Dilemma: The width will depend on whether we have
+ // But on the other hand, we set the label size carefully not to overflow.
+ tab_scroll_view->set_hide_horizontal_scrollbar(true);
pane_->AddTab(
l10n_util::GetStringUTF16(IDS_DESKTOP_MEDIA_PICKER_SOURCE_TYPE_TAB),

Powered by Google App Engine
This is Rietveld 408576698