| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Base class for tray containers. Sets the border and layout. The container | 35 // Base class for tray containers. Sets the border and layout. The container |
| 36 // auto-resizes the widget when necessary. | 36 // auto-resizes the widget when necessary. |
| 37 class TrayContainer : public views::View { | 37 class TrayContainer : public views::View { |
| 38 public: | 38 public: |
| 39 explicit TrayContainer(ShelfAlignment alignment); | 39 explicit TrayContainer(ShelfAlignment alignment); |
| 40 ~TrayContainer() override {} | 40 ~TrayContainer() override {} |
| 41 | 41 |
| 42 void SetAlignment(ShelfAlignment alignment); | 42 void SetAlignment(ShelfAlignment alignment); |
| 43 | 43 |
| 44 void set_size(const gfx::Size& size) { size_ = size; } | |
| 45 | |
| 46 void SetMargin(int main_axis_margin, int cross_axis_margin); | 44 void SetMargin(int main_axis_margin, int cross_axis_margin); |
| 47 | 45 |
| 48 // views::View: | |
| 49 gfx::Size GetPreferredSize() const override; | |
| 50 | |
| 51 protected: | 46 protected: |
| 52 // views::View: | 47 // views::View: |
| 53 void ChildPreferredSizeChanged(views::View* child) override; | 48 void ChildPreferredSizeChanged(views::View* child) override; |
| 54 void ChildVisibilityChanged(View* child) override; | 49 void ChildVisibilityChanged(View* child) override; |
| 55 void ViewHierarchyChanged( | 50 void ViewHierarchyChanged( |
| 56 const ViewHierarchyChangedDetails& details) override; | 51 const ViewHierarchyChangedDetails& details) override; |
| 57 | 52 |
| 58 private: | 53 private: |
| 59 void UpdateLayout(); | 54 void UpdateLayout(); |
| 60 | 55 |
| 61 ShelfAlignment alignment_; | 56 ShelfAlignment alignment_; |
| 62 gfx::Size size_; | |
| 63 int main_axis_margin_ = 0; | 57 int main_axis_margin_ = 0; |
| 64 int cross_axis_margin_ = 0; | 58 int cross_axis_margin_ = 0; |
| 65 | 59 |
| 66 DISALLOW_COPY_AND_ASSIGN(TrayContainer); | 60 DISALLOW_COPY_AND_ASSIGN(TrayContainer); |
| 67 }; | 61 }; |
| 68 | 62 |
| 69 explicit TrayBackgroundView(WmShelf* wm_shelf); | 63 explicit TrayBackgroundView(WmShelf* wm_shelf); |
| 70 ~TrayBackgroundView() override; | 64 ~TrayBackgroundView() override; |
| 71 | 65 |
| 72 // Called after the tray has been added to the widget containing it. | 66 // Called after the tray has been added to the widget containing it. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 171 |
| 178 std::unique_ptr<TrayWidgetObserver> widget_observer_; | 172 std::unique_ptr<TrayWidgetObserver> widget_observer_; |
| 179 std::unique_ptr<TrayEventFilter> tray_event_filter_; | 173 std::unique_ptr<TrayEventFilter> tray_event_filter_; |
| 180 | 174 |
| 181 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); | 175 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); |
| 182 }; | 176 }; |
| 183 | 177 |
| 184 } // namespace ash | 178 } // namespace ash |
| 185 | 179 |
| 186 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 180 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| OLD | NEW |