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/tray/tray_image_item.h" | 5 #include "ash/system/tray/tray_image_item.h" |
6 | 6 |
7 #include "ash/common/wm/shelf/wm_shelf_util.h" | 7 #include "ash/common/shelf/wm_shelf_util.h" |
8 #include "ash/shelf/shelf_util.h" | 8 #include "ash/shelf/shelf_util.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/tray_item_view.h" | 10 #include "ash/system/tray/tray_item_view.h" |
11 #include "ash/system/tray/tray_utils.h" | 11 #include "ash/system/tray/tray_utils.h" |
12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
14 #include "ui/views/controls/image_view.h" | 14 #include "ui/views/controls/image_view.h" |
15 #include "ui/views/layout/box_layout.h" | 15 #include "ui/views/layout/box_layout.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return NULL; | 51 return NULL; |
52 } | 52 } |
53 | 53 |
54 views::View* TrayImageItem::CreateDetailedView(user::LoginStatus status) { | 54 views::View* TrayImageItem::CreateDetailedView(user::LoginStatus status) { |
55 return NULL; | 55 return NULL; |
56 } | 56 } |
57 | 57 |
58 void TrayImageItem::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 58 void TrayImageItem::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
59 } | 59 } |
60 | 60 |
61 void TrayImageItem::UpdateAfterShelfAlignmentChange( | 61 void TrayImageItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { |
62 wm::ShelfAlignment alignment) { | |
63 SetTrayImageItemBorder(tray_view_, alignment); | 62 SetTrayImageItemBorder(tray_view_, alignment); |
64 SetItemAlignment(alignment); | 63 SetItemAlignment(alignment); |
65 } | 64 } |
66 | 65 |
67 void TrayImageItem::DestroyTrayView() { | 66 void TrayImageItem::DestroyTrayView() { |
68 tray_view_ = NULL; | 67 tray_view_ = NULL; |
69 } | 68 } |
70 | 69 |
71 void TrayImageItem::DestroyDefaultView() { | 70 void TrayImageItem::DestroyDefaultView() { |
72 } | 71 } |
73 | 72 |
74 void TrayImageItem::DestroyDetailedView() { | 73 void TrayImageItem::DestroyDetailedView() { |
75 } | 74 } |
76 | 75 |
77 void TrayImageItem::SetItemAlignment(wm::ShelfAlignment alignment) { | 76 void TrayImageItem::SetItemAlignment(ShelfAlignment alignment) { |
78 // Center the item dependent on the orientation of the shelf. | 77 // Center the item dependent on the orientation of the shelf. |
79 views::BoxLayout::Orientation layout = wm::IsHorizontalAlignment(alignment) | 78 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) |
80 ? views::BoxLayout::kHorizontal | 79 ? views::BoxLayout::kHorizontal |
81 : views::BoxLayout::kVertical; | 80 : views::BoxLayout::kVertical; |
82 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 81 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
83 tray_view_->Layout(); | 82 tray_view_->Layout(); |
84 } | 83 } |
85 | 84 |
86 } // namespace ash | 85 } // namespace ash |
OLD | NEW |