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