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

Unified Diff: ash/system/tray/system_tray.cc

Issue 2889623002: Apply View::set_preferred_size in some more places. (Closed)
Patch Set: fix SystemMenuButton 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/tray/system_menu_button.cc ('k') | ash/system/tray/tray_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 49c382b7d5d7ad11319dc3f92d62625e971aaad0..a86e9621b3fc4ea6ecf06e5f8f401a40a7dacac0 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -88,26 +88,15 @@ class PaddingTrayItem : public SystemTrayItem {
// SystemTrayItem:
views::View* CreateTrayView(LoginStatus status) override {
- return new PaddingView();
+ auto* padding = new views::View();
+ // The other tray items already have some padding baked in so we have to
+ // subtract that off.
+ constexpr int side = kTrayEdgePadding - kTrayImageItemPadding;
+ padding->set_preferred_size(gfx::Size(side, side));
+ return padding;
}
private:
- class PaddingView : public views::View {
- public:
- PaddingView() {}
- ~PaddingView() override {}
-
- private:
- gfx::Size GetPreferredSize() const override {
- // The other tray items already have some padding baked in so we have to
- // subtract that off.
- const int side = kTrayEdgePadding - kTrayImageItemPadding;
- return gfx::Size(side, side);
- }
-
- DISALLOW_COPY_AND_ASSIGN(PaddingView);
- };
-
DISALLOW_COPY_AND_ASSIGN(PaddingTrayItem);
};
« no previous file with comments | « ash/system/tray/system_menu_button.cc ('k') | ash/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698