Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_ | |
| 6 #define ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/views/view.h" | |
| 10 | |
| 11 namespace ash { | |
| 12 class WmShelf; | |
| 13 | |
| 14 // Base class for tray containers. Sets the border and layout. The container | |
| 15 // auto-resizes the widget when necessary. | |
| 16 class TrayContainer : public views::View { | |
| 17 public: | |
| 18 explicit TrayContainer(WmShelf* wm_shelf); | |
| 19 ~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.
| |
| 20 | |
| 21 void UpdateAfterShelfAlignmentChange(); | |
| 22 | |
| 23 void SetMargin(int main_axis_margin, int cross_axis_margin); | |
| 24 | |
| 25 protected: | |
| 26 // views::View: | |
| 27 void ChildPreferredSizeChanged(views::View* child) override; | |
| 28 void ChildVisibilityChanged(View* child) override; | |
| 29 void ViewHierarchyChanged( | |
| 30 const ViewHierarchyChangedDetails& details) override; | |
| 31 | |
| 32 private: | |
| 33 void UpdateLayout(); | |
| 34 | |
| 35 WmShelf* const wm_shelf_; | |
| 36 | |
| 37 int main_axis_margin_ = 0; | |
| 38 int cross_axis_margin_ = 0; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(TrayContainer); | |
| 41 }; | |
| 42 | |
| 43 } // namespace ash | |
| 44 | |
| 45 #endif // ASH_SYSTEM_TRAY_TRAY_CONTAINER_H_ | |
| OLD | NEW |