OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/screen_security/screen_tray_item.h" | 5 #include "ash/system/chromeos/screen_security/screen_tray_item.h" |
6 | 6 |
7 #include "ash/system/tray/fixed_sized_image_view.h" | 7 #include "ash/system/tray/fixed_sized_image_view.h" |
8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/message_center/message_center.h" | 10 #include "ui/message_center/message_center.h" |
11 #include "ui/views/controls/label.h" | 11 #include "ui/views/controls/label.h" |
12 #include "ui/views/layout/box_layout.h" | 12 #include "ui/views/layout/box_layout.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 const int kStopButtonRightPadding = 18; | 15 const int kStopButtonRightPadding = 18; |
16 } // namespace | 16 } // namespace |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace internal { | |
20 | |
21 namespace tray { | 19 namespace tray { |
22 | 20 |
23 // ScreenTrayView implementations. | 21 // ScreenTrayView implementations. |
24 ScreenTrayView::ScreenTrayView(ScreenTrayItem* screen_tray_item, int icon_id) | 22 ScreenTrayView::ScreenTrayView(ScreenTrayItem* screen_tray_item, int icon_id) |
25 : TrayItemView(screen_tray_item), | 23 : TrayItemView(screen_tray_item), |
26 screen_tray_item_(screen_tray_item) { | 24 screen_tray_item_(screen_tray_item) { |
27 CreateImageView(); | 25 CreateImageView(); |
28 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() | 26 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() |
29 .GetImageNamed(icon_id).ToImageSkia()); | 27 .GetImageNamed(icon_id).ToImageSkia()); |
30 | 28 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // Center the item dependent on the orientation of the shelf. | 201 // Center the item dependent on the orientation of the shelf. |
204 views::BoxLayout::Orientation layout = | 202 views::BoxLayout::Orientation layout = |
205 (alignment == ash::SHELF_ALIGNMENT_BOTTOM || | 203 (alignment == ash::SHELF_ALIGNMENT_BOTTOM || |
206 alignment == ash::SHELF_ALIGNMENT_TOP) | 204 alignment == ash::SHELF_ALIGNMENT_TOP) |
207 ? views::BoxLayout::kHorizontal | 205 ? views::BoxLayout::kHorizontal |
208 : views::BoxLayout::kVertical; | 206 : views::BoxLayout::kVertical; |
209 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 207 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
210 tray_view_->Layout(); | 208 tray_view_->Layout(); |
211 } | 209 } |
212 | 210 |
213 } // namespace internal | |
214 } // namespace ash | 211 } // namespace ash |
OLD | NEW |