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

Unified Diff: ash/common/system/tray/tray_details_view.cc

Issue 2671063002: Remove FixedSizedScrollView. (Closed)
Patch Set: rebase Created 3 years, 10 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 | « ash/common/system/tray/tray_details_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_details_view.cc
diff --git a/ash/common/system/tray/tray_details_view.cc b/ash/common/system/tray/tray_details_view.cc
index 1b1b6f9b4d88e38f3fe7d7281f81fc28cb893955..1d0dd38eb1acd05ee174fda4def6486b3fd10c79 100644
--- a/ash/common/system/tray/tray_details_view.cc
+++ b/ash/common/system/tray/tray_details_view.cc
@@ -6,7 +6,6 @@
#include "ash/common/ash_view_ids.h"
#include "ash/common/material_design/material_design_controller.h"
-#include "ash/common/system/tray/fixed_sized_scroll_view.h"
#include "ash/common/system/tray/system_menu_button.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h"
@@ -363,8 +362,8 @@ void TrayDetailsView::CreateTitleRow(int string_id) {
void TrayDetailsView::CreateScrollableList() {
DCHECK(!scroller_);
scroll_content_ = new ScrollContentsView();
- scroller_ = new FixedSizedScrollView;
- scroller_->SetContentsView(scroll_content_);
+ scroller_ = new views::ScrollView;
+ scroller_->SetContents(scroll_content_);
// Make the |scroller_| have a layer to clip |scroll_content_|'s children.
// TODO(varkha): Make the sticky rows work with EnableViewPortLayer().
scroller_->SetPaintToLayer();
@@ -492,39 +491,9 @@ views::Button* TrayDetailsView::CreateBackButton() {
}
void TrayDetailsView::Layout() {
- if (UseMd()) {
- views::View::Layout();
- if (scroller_ && !scroller_->is_bounded())
- scroller_->ClipHeightTo(0, scroller_->height());
- return;
- }
-
- if (bounds().IsEmpty()) {
- views::View::Layout();
- return;
- }
-
- if (scroller_) {
- scroller_->set_fixed_size(gfx::Size());
- gfx::Size size = GetPreferredSize();
-
- // Set the scroller to fill the space above the bottom row, so that the
- // bottom row of the detailed view will always stay just above the title
- // row.
- gfx::Size scroller_size = scroll_content_->GetPreferredSize();
- scroller_->set_fixed_size(
- gfx::Size(width() + scroller_->GetScrollBarLayoutWidth(),
- scroller_size.height() - (size.height() - height())));
- }
-
views::View::Layout();
-
- if (title_row_) {
- // Always make sure the title row is bottom-aligned in non-MD.
- gfx::Rect fbounds = title_row_->bounds();
- fbounds.set_y(height() - title_row_->height());
- title_row_->SetBoundsRect(fbounds);
- }
+ if (scroller_ && !scroller_->is_bounded())
+ scroller_->ClipHeightTo(0, scroller_->height());
}
int TrayDetailsView::GetHeightForWidth(int width) const {
« no previous file with comments | « ash/common/system/tray/tray_details_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698