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 25 matching lines...) Expand all Loading... |
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; } | 44 void set_size(const gfx::Size& size) { size_ = size; } |
45 | 45 |
| 46 void SetMargin(const gfx::Insets& margin); |
| 47 |
46 // views::View: | 48 // views::View: |
47 gfx::Size GetPreferredSize() const override; | 49 gfx::Size GetPreferredSize() const override; |
48 | 50 |
49 protected: | 51 protected: |
50 // views::View: | 52 // views::View: |
51 void ChildPreferredSizeChanged(views::View* child) override; | 53 void ChildPreferredSizeChanged(views::View* child) override; |
52 void ChildVisibilityChanged(View* child) override; | 54 void ChildVisibilityChanged(View* child) override; |
53 void ViewHierarchyChanged( | 55 void ViewHierarchyChanged( |
54 const ViewHierarchyChangedDetails& details) override; | 56 const ViewHierarchyChangedDetails& details) override; |
55 | 57 |
56 private: | 58 private: |
57 void UpdateLayout(); | 59 void UpdateLayout(); |
58 | 60 |
59 ShelfAlignment alignment_; | 61 ShelfAlignment alignment_; |
60 gfx::Size size_; | 62 gfx::Size size_; |
| 63 gfx::Insets margin_; |
61 | 64 |
62 DISALLOW_COPY_AND_ASSIGN(TrayContainer); | 65 DISALLOW_COPY_AND_ASSIGN(TrayContainer); |
63 }; | 66 }; |
64 | 67 |
65 explicit TrayBackgroundView(WmShelf* wm_shelf); | 68 explicit TrayBackgroundView(WmShelf* wm_shelf); |
66 ~TrayBackgroundView() override; | 69 ~TrayBackgroundView() override; |
67 | 70 |
68 // Called after the tray has been added to the widget containing it. | 71 // Called after the tray has been added to the widget containing it. |
69 virtual void Initialize(); | 72 virtual void Initialize(); |
70 | 73 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 172 |
170 std::unique_ptr<TrayWidgetObserver> widget_observer_; | 173 std::unique_ptr<TrayWidgetObserver> widget_observer_; |
171 std::unique_ptr<TrayEventFilter> tray_event_filter_; | 174 std::unique_ptr<TrayEventFilter> tray_event_filter_; |
172 | 175 |
173 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); | 176 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); |
174 }; | 177 }; |
175 | 178 |
176 } // namespace ash | 179 } // namespace ash |
177 | 180 |
178 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 181 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
OLD | NEW |