Chromium Code Reviews| 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..2dcefd4f6476bc334111a2b4b930e5734efb7c5c |
| --- /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 {} |
|
James Cook
2017/04/17 16:54:35
nit: prefer to define {} in the .cc file
mohsen
2017/04/19 22:59:07
Done.
|
| + |
| + 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_ |