| 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/common/system/tray/tray_image_item.h" | 5 #include "ash/common/system/tray/tray_image_item.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.h" |
| 9 #include "ash/common/system/tray/system_tray.h" | 9 #include "ash/common/system/tray/system_tray.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 default: | 47 default: |
| 48 NOTREACHED(); | 48 NOTREACHED(); |
| 49 break; | 49 break; |
| 50 } | 50 } |
| 51 | 51 |
| 52 return vector_id; | 52 return vector_id; |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace | 55 } // namespace |
| 56 | 56 |
| 57 TrayImageItem::TrayImageItem(SystemTray* system_tray, int resource_id) | 57 TrayImageItem::TrayImageItem(SystemTray* system_tray, |
| 58 : SystemTrayItem(system_tray), | 58 int resource_id, |
| 59 UmaType uma_type) |
| 60 : SystemTrayItem(system_tray, uma_type), |
| 59 resource_id_(resource_id), | 61 resource_id_(resource_id), |
| 60 tray_view_(nullptr) {} | 62 tray_view_(nullptr) {} |
| 61 | 63 |
| 62 TrayImageItem::~TrayImageItem() {} | 64 TrayImageItem::~TrayImageItem() {} |
| 63 | 65 |
| 64 views::View* TrayImageItem::tray_view() { | 66 views::View* TrayImageItem::tray_view() { |
| 65 return tray_view_; | 67 return tray_view_; |
| 66 } | 68 } |
| 67 | 69 |
| 68 views::View* TrayImageItem::CreateTrayView(LoginStatus status) { | 70 views::View* TrayImageItem::CreateTrayView(LoginStatus status) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void TrayImageItem::SetItemAlignment(ShelfAlignment alignment) { | 123 void TrayImageItem::SetItemAlignment(ShelfAlignment alignment) { |
| 122 // Center the item dependent on the orientation of the shelf. | 124 // Center the item dependent on the orientation of the shelf. |
| 123 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) | 125 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) |
| 124 ? views::BoxLayout::kHorizontal | 126 ? views::BoxLayout::kHorizontal |
| 125 : views::BoxLayout::kVertical; | 127 : views::BoxLayout::kVertical; |
| 126 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 128 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
| 127 tray_view_->Layout(); | 129 tray_view_->Layout(); |
| 128 } | 130 } |
| 129 | 131 |
| 130 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |