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

Side by Side Diff: ash/common/system/tray/tray_details_view.cc

Issue 2509243002: Revert of Don't reset scroll position of contents on every ScrollView layout. (Closed)
Patch Set: Created 4 years, 1 month 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 | « ash/common/system/tray/fixed_sized_scroll_view.cc ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/common/system/tray/tray_details_view.h" 5 #include "ash/common/system/tray/tray_details_view.h"
6 6
7 #include "ash/common/ash_view_ids.h" 7 #include "ash/common/ash_view_ids.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h"
10 #include "ash/common/system/tray/system_menu_button.h" 10 #include "ash/common/system/tray/system_menu_button.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuArrowBackIcon, 477 this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuArrowBackIcon,
478 IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); 478 IDS_ASH_STATUS_TRAY_PREVIOUS_MENU);
479 return button; 479 return button;
480 } 480 }
481 481
482 void TrayDetailsView::Layout() { 482 void TrayDetailsView::Layout() {
483 if (UseMd()) { 483 if (UseMd()) {
484 views::View::Layout(); 484 views::View::Layout();
485 if (scroller_ && !scroller_->is_bounded()) 485 if (scroller_ && !scroller_->is_bounded())
486 scroller_->ClipHeightTo(0, scroller_->height()); 486 scroller_->ClipHeightTo(0, scroller_->height());
487 return;
488 } 487 }
489 488
490 if (bounds().IsEmpty()) { 489 if (UseMd() || bounds().IsEmpty()) {
491 views::View::Layout(); 490 views::View::Layout();
492 return; 491 return;
493 } 492 }
494 493
495 if (scroller_) { 494 if (scroller_) {
496 scroller_->set_fixed_size(gfx::Size()); 495 scroller_->set_fixed_size(gfx::Size());
497 gfx::Size size = GetPreferredSize(); 496 gfx::Size size = GetPreferredSize();
498 497
499 // Set the scroller to fill the space above the bottom row, so that the 498 // Set the scroller to fill the space above the bottom row, so that the
500 // bottom row of the detailed view will always stay just above the title 499 // bottom row of the detailed view will always stay just above the title
(...skipping 30 matching lines...) Expand all
531 if (index < child_count() - 1 && child_at(index + 1) != title_row_) 530 if (index < child_count() - 1 && child_at(index + 1) != title_row_)
532 scroll_border_->set_visible(true); 531 scroll_border_->set_visible(true);
533 else 532 else
534 scroll_border_->set_visible(false); 533 scroll_border_->set_visible(false);
535 } 534 }
536 535
537 views::View::OnPaintBorder(canvas); 536 views::View::OnPaintBorder(canvas);
538 } 537 }
539 538
540 } // namespace ash 539 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/fixed_sized_scroll_view.cc ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698