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.h" | 5 #include "ash/system/status_area_widget.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/status_area_widget_delegate.h" | 9 #include "ash/system/status_area_widget_delegate.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 Init(params); | 24 Init(params); |
25 set_focus_on_creation(false); | 25 set_focus_on_creation(false); |
26 SetContentsView(widget_delegate_); | 26 SetContentsView(widget_delegate_); |
27 GetNativeView()->SetName("StatusAreaWidget"); | 27 GetNativeView()->SetName("StatusAreaWidget"); |
28 } | 28 } |
29 | 29 |
30 StatusAreaWidget::~StatusAreaWidget() { | 30 StatusAreaWidget::~StatusAreaWidget() { |
31 } | 31 } |
32 | 32 |
33 void StatusAreaWidget::AddTray(views::View* tray) { | 33 void StatusAreaWidget::AddTray(views::View* tray) { |
34 widget_delegate_->AddChildView(tray); | 34 widget_delegate_->AddTray(tray); |
35 widget_delegate_->Layout(); | |
36 } | 35 } |
37 | 36 |
38 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { | 37 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { |
39 if (alignment == SHELF_ALIGNMENT_BOTTOM) | 38 widget_delegate_->set_alignment(alignment); |
40 widget_delegate_->SetLayout(views::BoxLayout::kHorizontal); | 39 widget_delegate_->UpdateLayout(); |
41 else | |
42 widget_delegate_->SetLayout(views::BoxLayout::kVertical); | |
43 } | 40 } |
44 | 41 |
45 } // namespace internal | 42 } // namespace internal |
46 } // namespace ash | 43 } // namespace ash |
OLD | NEW |