Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: ash/system/status_area_widget.cc

Issue 10514008: Add WebNotificationTray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698