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

Unified Diff: ash/system/tray/tray_container.h

Issue 2807693002: Make LogoutButtonTray a regular View (Closed)
Patch Set: Rebased Created 3 years, 8 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/tray_background_view.cc ('k') | ash/system/tray/tray_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_container.h
diff --git a/ash/system/tray/tray_container.h b/ash/system/tray/tray_container.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4c7ea76791c0c765b42ff9c0e1a419a7923d5e5
--- /dev/null
+++ b/ash/system/tray/tray_container.h
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_
+#define ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_
+
+#include "base/macros.h"
+#include "ui/views/view.h"
+
+namespace ash {
+class WmShelf;
+
+// Base class for tray containers. Sets the border and layout. The container
+// auto-resizes the widget when necessary.
+class TrayContainer : public views::View {
+ public:
+ explicit TrayContainer(WmShelf* wm_shelf);
+ ~TrayContainer() override;
+
+ void UpdateAfterShelfAlignmentChange();
+
+ void SetMargin(int main_axis_margin, int cross_axis_margin);
+
+ protected:
+ // views::View:
+ void ChildPreferredSizeChanged(views::View* child) override;
+ void ChildVisibilityChanged(View* child) override;
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override;
+
+ private:
+ void UpdateLayout();
+
+ WmShelf* const wm_shelf_;
+
+ int main_axis_margin_ = 0;
+ int cross_axis_margin_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayContainer);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_
« no previous file with comments | « ash/system/tray/tray_background_view.cc ('k') | ash/system/tray/tray_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698