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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 2881183003: Add views::View::set_preferred_size, use it in a few places. (Closed)
Patch Set: auto* Created 3 years, 7 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/system/user/user_card_view.cc ('k') | ui/views/controls/image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 8216b743b3e9628537f26b3fb9029046eabf6621..a17eb8620f67da8b5eaf9121d4c644af8a78a96b 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -273,20 +273,6 @@ class BackgroundColorHoverButton : public views::LabelButton {
DISALLOW_COPY_AND_ASSIGN(BackgroundColorHoverButton);
};
-// SizedContainer -------------------------------------------------
-
-// A simple container view that takes an explicit preferred size.
-class SizedContainer : public views::View {
- public:
- explicit SizedContainer(const gfx::Size& preferred_size)
- : preferred_size_(preferred_size) {}
-
- gfx::Size GetPreferredSize() const override { return preferred_size_; }
-
- private:
- gfx::Size preferred_size_;
-};
-
// A view to host the GAIA webview overlapped with a back button. This class
// is needed to reparent the back button inside a native view so that on
// windows, user input can be be properly routed to the button.
@@ -1275,8 +1261,9 @@ views::View* ProfileChooserView::CreateSyncErrorViewIfNeeded() {
// already initialized.
DCHECK(button_out);
// Adds a padding row between error title/content and the button.
- SizedContainer* padding =
- new SizedContainer(gfx::Size(0, views::kRelatedControlVerticalSpacing));
+ auto* padding = new views::View;
+ padding->set_preferred_size(
+ gfx::Size(0, views::kRelatedControlVerticalSpacing));
vertical_view->AddChildView(padding);
*button_out = views::MdTextButton::CreateSecondaryUiBlueButton(
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | ui/views/controls/image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698