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

Unified Diff: ash/common/system/user/user_view.cc

Issue 2475033003: Add ability to specify extra insets for a view via its border. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/border.h » ('j') | ui/views/border.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/user/user_view.cc
diff --git a/ash/common/system/user/user_view.cc b/ash/common/system/user/user_view.cc
index 6dc3605ef973541d0e09cedb46aba578e0c5e532..7c764bbc4c666a397bff9bc5b5f544a4eadba724 100644
--- a/ash/common/system/user/user_view.cc
+++ b/ash/common/system/user/user_view.cc
@@ -573,19 +573,14 @@ void UserView::ToggleAddUserMenuOption() {
bounds.set_height(row_height * 2);
add_menu_option_->SetBounds(bounds);
- // This nested container is necessary to stack borders.
- views::View* nested_container = new views::View();
- nested_container->SetBorder(
- views::Border::CreateEmptyBorder(row_height, 0, 0, 0));
- nested_container->SetLayoutManager(new views::FillLayout());
- nested_container->AddChildView(button);
-
views::View* container = new AddUserWidgetContents(
base::Bind(&UserView::RemoveAddUserMenuOption, base::Unretained(this)));
- container->SetBorder(views::Border::CreateSolidSidedBorder(
- 0, 0, 0, kSeparatorWidth, kBackgroundColor));
+ container->SetBorder(views::Border::AddInteriorPadding(
+ views::Border::CreateSolidSidedBorder(0, 0, 0, kSeparatorWidth,
+ kBackgroundColor),
+ gfx::Insets(row_height, 0, 0, 0)));
container->SetLayoutManager(new views::FillLayout());
- container->AddChildView(nested_container);
+ container->AddChildView(button);
add_menu_option_->SetContentsView(container);
} else {
add_menu_option_->SetOpacity(1.f);
« no previous file with comments | « no previous file | ui/views/border.h » ('j') | ui/views/border.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698