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 #include "ash/system/status_area_widget_delegate.h" | 5 #include "ash/system/status_area_widget_delegate.h" |
6 | 6 |
7 #include "ash/ash_export.h" | 7 #include "ash/ash_export.h" |
8 #include "ash/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 0, /* resize percent */ | 103 0, /* resize percent */ |
104 views::GridLayout::USE_PREF, 0, 0); | 104 views::GridLayout::USE_PREF, 0, 0); |
105 for (int c = 0; c < child_count(); ++c) { | 105 for (int c = 0; c < child_count(); ++c) { |
106 if (c != 0) | 106 if (c != 0) |
107 layout->AddPaddingRow(0, kTraySpacing); | 107 layout->AddPaddingRow(0, kTraySpacing); |
108 layout->StartRow(0, 0); | 108 layout->StartRow(0, 0); |
109 layout->AddView(child_at(c)); | 109 layout->AddView(child_at(c)); |
110 } | 110 } |
111 } | 111 } |
112 Layout(); | 112 Layout(); |
| 113 UpdateWidgetSize(); |
113 } | 114 } |
114 | 115 |
115 void StatusAreaWidgetDelegate::ChildPreferredSizeChanged(View* child) { | 116 void StatusAreaWidgetDelegate::ChildPreferredSizeChanged(View* child) { |
116 // Need to resize the window when trays or items are added/removed. | 117 // Need to resize the window when trays or items are added/removed. |
| 118 UpdateWidgetSize(); |
| 119 } |
| 120 |
| 121 void StatusAreaWidgetDelegate::UpdateWidgetSize() { |
117 if (GetWidget()) | 122 if (GetWidget()) |
118 GetWidget()->SetSize(GetPreferredSize()); | 123 GetWidget()->SetSize(GetPreferredSize()); |
119 } | 124 } |
120 | 125 |
121 } // namespace internal | 126 } // namespace internal |
122 } // namespace ash | 127 } // namespace ash |
OLD | NEW |