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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 1742953002: Simplify ash shelf layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore ConvertRectToScreen calls. Created 4 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/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 606b4d8ac3d9f0d37579fd3431188734f10e195e..74d5abf858bc96784bd37872caddec206e1ed9fd 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -34,6 +34,7 @@
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/skbitmap_operations.h"
#include "ui/views/accessible_pane_view.h"
+#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/wm/core/coordinate_conversion.h"
@@ -343,7 +344,6 @@ class ShelfWidget::DelegateView : public views::WidgetDelegate,
const views::Widget* GetWidget() const override { return View::GetWidget(); }
bool CanActivate() const override;
- void Layout() override;
void ReorderChildLayers(ui::Layer* parent_layer) override;
// This will be called when the parent local bounds change.
void OnBoundsChanged(const gfx::Rect& old_bounds) override;
@@ -406,6 +406,7 @@ ShelfWidget::DelegateView::DelegateView(ShelfWidget* shelf)
opaque_foreground_(ui::LAYER_SOLID_COLOR),
dimmer_view_(NULL),
disable_dimming_animations_for_test_(false) {
+ SetLayoutManager(new views::FillLayout());
set_allow_deactivate_on_esc(true);
opaque_background_.SetColor(SK_ColorBLACK);
opaque_background_.SetBounds(GetLocalBounds());
@@ -550,18 +551,6 @@ bool ShelfWidget::DelegateView::CanActivate() const {
return false;
}
-void ShelfWidget::DelegateView::Layout() {
- for(int i = 0; i < child_count(); ++i) {
- if (shelf_->shelf_layout_manager()->IsHorizontalAlignment()) {
- child_at(i)->SetBounds(child_at(i)->x(), child_at(i)->y(),
- child_at(i)->width(), height());
- } else {
- child_at(i)->SetBounds(child_at(i)->x(), child_at(i)->y(),
- width(), child_at(i)->height());
- }
- }
-}
-
void ShelfWidget::DelegateView::ReorderChildLayers(ui::Layer* parent_layer) {
views::View::ReorderChildLayers(parent_layer);
parent_layer->StackAtBottom(&opaque_background_);
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698