Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 SetSize(gfx::Size(active_style_->columns * active_style_->item_size.width(), | |
|
msw
2016/09/02 00:35:29
Layout() is typically called in response to size c
qiangchen
2016/09/02 16:19:52
See my comment#5 in the bug for a thorough cause.
sky
2016/09/02 18:38:30
I agree this seems weird, but ScrollView has weird
qiangchen
2016/09/02 22:10:57
Done.
As our logic guarantees no horizontal overf
| |
| 123 y + active_style_->item_size.height())); | |
| 121 } | 124 } |
| 122 | 125 |
| 123 bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) { | 126 bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) { |
| 124 int position_increment = 0; | 127 int position_increment = 0; |
| 125 switch (event.key_code()) { | 128 switch (event.key_code()) { |
| 126 case ui::VKEY_UP: | 129 case ui::VKEY_UP: |
| 127 position_increment = -active_style_->columns; | 130 position_increment = -active_style_->columns; |
| 128 break; | 131 break; |
| 129 case ui::VKEY_DOWN: | 132 case ui::VKEY_DOWN: |
| 130 position_increment = active_style_->columns; | 133 position_increment = active_style_->columns; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 } | 276 } |
| 274 | 277 |
| 275 DesktopMediaSourceView* DesktopMediaListView::GetChild(int index) { | 278 DesktopMediaSourceView* DesktopMediaListView::GetChild(int index) { |
| 276 return static_cast<DesktopMediaSourceView*>(child_at(index)); | 279 return static_cast<DesktopMediaSourceView*>(child_at(index)); |
| 277 } | 280 } |
| 278 | 281 |
| 279 void DesktopMediaListView::GetAccessibleState(ui::AXViewState* state) { | 282 void DesktopMediaListView::GetAccessibleState(ui::AXViewState* state) { |
| 280 state->role = ui::AX_ROLE_GROUP; | 283 state->role = ui::AX_ROLE_GROUP; |
| 281 state->name = accessible_name_; | 284 state->name = accessible_name_; |
| 282 } | 285 } |
| OLD | NEW |