| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/date/system_info_default_view.h" | 5 #include "ash/common/system/date/system_info_default_view.h" |
| 6 | 6 |
| 7 #include "ash/common/system/chromeos/power/power_status.h" | 7 #include "ash/common/system/chromeos/power/power_status.h" |
| 8 #include "ash/common/system/chromeos/power/power_status_view.h" | 8 #include "ash/common/system/chromeos/power/power_status_view.h" |
| 9 #include "ash/common/system/date/date_view.h" | 9 #include "ash/common/system/date/date_view.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 : date_view_(nullptr), | 30 : date_view_(nullptr), |
| 31 tri_view_(TrayPopupUtils::CreateMultiTargetRowView()) { | 31 tri_view_(TrayPopupUtils::CreateMultiTargetRowView()) { |
| 32 tri_view_->SetMinHeight(kTrayPopupSystemInfoRowHeight); | 32 tri_view_->SetMinHeight(kTrayPopupSystemInfoRowHeight); |
| 33 AddChildView(tri_view_); | 33 AddChildView(tri_view_); |
| 34 SetLayoutManager(new views::FillLayout); | 34 SetLayoutManager(new views::FillLayout); |
| 35 | 35 |
| 36 date_view_ = new tray::DateView(owner); | 36 date_view_ = new tray::DateView(owner); |
| 37 tri_view_->AddView(TriView::Container::START, date_view_); | 37 tri_view_->AddView(TriView::Container::START, date_view_); |
| 38 | 38 |
| 39 if (PowerStatus::Get()->IsBatteryPresent()) { | 39 if (PowerStatus::Get()->IsBatteryPresent()) { |
| 40 power_status_view_ = new ash::PowerStatusView(false); | 40 power_status_view_ = new ash::PowerStatusView(); |
| 41 std::unique_ptr<views::BoxLayout> box_layout = | 41 std::unique_ptr<views::BoxLayout> box_layout = |
| 42 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal, 0, 0, | 42 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal, 0, 0, |
| 43 0); | 43 0); |
| 44 box_layout->set_cross_axis_alignment( | 44 box_layout->set_cross_axis_alignment( |
| 45 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); | 45 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); |
| 46 box_layout->set_inside_border_insets( | 46 box_layout->set_inside_border_insets( |
| 47 gfx::Insets(0, 0, 0, kTrayPopupLabelRightPadding)); | 47 gfx::Insets(0, 0, 0, kTrayPopupLabelRightPadding)); |
| 48 tri_view_->SetContainerLayout(TriView::Container::CENTER, | 48 tri_view_->SetContainerLayout(TriView::Container::CENTER, |
| 49 std::move(box_layout)); | 49 std::move(box_layout)); |
| 50 | 50 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 num_extra_tile_widths = std::ceil(preferred_width_ratio); | 86 num_extra_tile_widths = std::ceil(preferred_width_ratio); |
| 87 } | 87 } |
| 88 num_extra_tile_widths = | 88 num_extra_tile_widths = |
| 89 std::max(kMinNumTileWidths - 1, | 89 std::max(kMinNumTileWidths - 1, |
| 90 std::min(num_extra_tile_widths, kMaxNumTileWidths - 1)); | 90 std::min(num_extra_tile_widths, kMaxNumTileWidths - 1)); |
| 91 | 91 |
| 92 return kMenuButtonSize + num_extra_tile_widths * snap_to_width; | 92 return kMenuButtonSize + num_extra_tile_widths * snap_to_width; |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |