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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 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
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 Layout(); 360 Layout();
361 } 361 }
362 362
363 void TrayDetailsView::CreateScrollableList() { 363 void TrayDetailsView::CreateScrollableList() {
364 DCHECK(!scroller_); 364 DCHECK(!scroller_);
365 scroll_content_ = new ScrollContentsView(); 365 scroll_content_ = new ScrollContentsView();
366 scroller_ = new FixedSizedScrollView; 366 scroller_ = new FixedSizedScrollView;
367 scroller_->SetContentsView(scroll_content_); 367 scroller_->SetContentsView(scroll_content_);
368 // Make the |scroller_| have a layer to clip |scroll_content_|'s children. 368 // Make the |scroller_| have a layer to clip |scroll_content_|'s children.
369 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer(). 369 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer().
370 scroller_->SetPaintToLayer(true); 370 scroller_->SetPaintToLayer();
371 scroller_->set_background( 371 scroller_->set_background(
372 views::Background::CreateSolidBackground(kBackgroundColor)); 372 views::Background::CreateSolidBackground(kBackgroundColor));
373 scroller_->layer()->SetMasksToBounds(true); 373 scroller_->layer()->SetMasksToBounds(true);
374 374
375 // Note: |scroller_| takes ownership of |scroll_border_|. 375 // Note: |scroller_| takes ownership of |scroll_border_|.
376 if (!UseMd()) { 376 if (!UseMd()) {
377 // In MD, the scroller is always the last thing, so this border is 377 // In MD, the scroller is always the last thing, so this border is
378 // unnecessary and reserves extra space we don't want. 378 // unnecessary and reserves extra space we don't want.
379 scroll_border_ = new ScrollBorder; 379 scroll_border_ = new ScrollBorder;
380 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_)); 380 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 if (index < child_count() - 1 && child_at(index + 1) != title_row_) 558 if (index < child_count() - 1 && child_at(index + 1) != title_row_)
559 scroll_border_->set_visible(true); 559 scroll_border_->set_visible(true);
560 else 560 else
561 scroll_border_->set_visible(false); 561 scroll_border_->set_visible(false);
562 } 562 }
563 563
564 views::View::OnPaintBorder(canvas); 564 views::View::OnPaintBorder(canvas);
565 } 565 }
566 566
567 } // namespace ash 567 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698