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

Side by Side Diff: chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc

Issue 2304743002: Bug Fix: Desktop Picker Window Shows Unnecessary Scrollbar (Closed)
Patch Set: Set the size to at least parent's Content Size Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/desktop_capture/desktop_media_list_view.h" 5 #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (i > 0 && i % active_style_->columns == 0) { 111 if (i > 0 && i % active_style_->columns == 0) {
112 x = 0; 112 x = 0;
113 y += active_style_->item_size.height(); 113 y += active_style_->item_size.height();
114 } 114 }
115 115
116 child_at(i)->SetBounds(x, y, active_style_->item_size.width(), 116 child_at(i)->SetBounds(x, y, active_style_->item_size.width(),
117 active_style_->item_size.height()); 117 active_style_->item_size.height());
118 118
119 x += active_style_->item_size.width(); 119 x += active_style_->item_size.width();
120 } 120 }
121
122 // TODO(qiangchen): Bounded ScrollView has a bug to display horizontal bar
123 // always, and then display vertical bar when the content just fit the
124 // container. See crbug/636338.
125 // Fix the underlying issue and remove the following code.
126 gfx::Size parent_content_size = parent()->GetContentsBounds().size();
127 SetSize(gfx::Size(parent_content_size.width(),
sky 2016/09/06 18:08:50 It seems like you have an inherent preferred width
qiangchen 2016/09/06 18:38:10 Done.
128 std::max(parent_content_size.height(),
129 y + active_style_->item_size.height())));
121 } 130 }
122 131
123 bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) { 132 bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) {
124 int position_increment = 0; 133 int position_increment = 0;
125 switch (event.key_code()) { 134 switch (event.key_code()) {
126 case ui::VKEY_UP: 135 case ui::VKEY_UP:
127 position_increment = -active_style_->columns; 136 position_increment = -active_style_->columns;
128 break; 137 break;
129 case ui::VKEY_DOWN: 138 case ui::VKEY_DOWN:
130 position_increment = active_style_->columns; 139 position_increment = active_style_->columns;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 282 }
274 283
275 DesktopMediaSourceView* DesktopMediaListView::GetChild(int index) { 284 DesktopMediaSourceView* DesktopMediaListView::GetChild(int index) {
276 return static_cast<DesktopMediaSourceView*>(child_at(index)); 285 return static_cast<DesktopMediaSourceView*>(child_at(index));
277 } 286 }
278 287
279 void DesktopMediaListView::GetAccessibleState(ui::AXViewState* state) { 288 void DesktopMediaListView::GetAccessibleState(ui::AXViewState* state) {
280 state->role = ui::AX_ROLE_GROUP; 289 state->role = ui::AX_ROLE_GROUP;
281 state->name = accessible_name_; 290 state->name = accessible_name_;
282 } 291 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698