| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/audio/volume_view.h" | 5 #include "ash/common/system/chromeos/audio/volume_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/metrics/user_metrics_action.h" | 10 #include "ash/common/metrics/user_metrics_action.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 .ToImageSkia()); | 200 .ToImageSkia()); |
| 201 } | 201 } |
| 202 more_button_->AddChildView(more_arrow); | 202 more_button_->AddChildView(more_arrow); |
| 203 | 203 |
| 204 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 204 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 205 more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); | 205 more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); |
| 206 tri_view_->AddView(TriView::Container::END, more_button_); | 206 tri_view_->AddView(TriView::Container::END, more_button_); |
| 207 } else { | 207 } else { |
| 208 separator_ = new views::Separator(views::Separator::VERTICAL); | 208 separator_ = new views::Separator(views::Separator::VERTICAL); |
| 209 separator_->SetColor(kButtonStrokeColor); | 209 separator_->SetColor(kButtonStrokeColor); |
| 210 separator_->SetPreferredSize(kSeparatorSize); | |
| 211 separator_->SetBorder(views::CreateEmptyBorder(kSeparatorVerticalInset, 0, | 210 separator_->SetBorder(views::CreateEmptyBorder(kSeparatorVerticalInset, 0, |
| 212 kSeparatorVerticalInset, | 211 kSeparatorVerticalInset, |
| 213 kBoxLayoutPadding)); | 212 kBoxLayoutPadding)); |
| 214 | 213 |
| 215 TrayPopupItemContainer* more_container = | 214 TrayPopupItemContainer* more_container = |
| 216 new TrayPopupItemContainer(separator_, true); | 215 new TrayPopupItemContainer(separator_, true); |
| 217 more_container->SetLayoutManager( | 216 more_container->SetLayoutManager( |
| 218 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 217 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
| 219 more_container->AddChildView(more_button_); | 218 more_container->AddChildView(more_button_); |
| 220 tri_view_->AddView(TriView::Container::END, more_container); | 219 tri_view_->AddView(TriView::Container::END, more_container); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 345 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 347 // Separator's prefered size is based on set bounds. When an empty bounds is | 346 // Separator's prefered size is based on set bounds. When an empty bounds is |
| 348 // set on first layout this causes BoxLayout to ignore the separator. Reset | 347 // set on first layout this causes BoxLayout to ignore the separator. Reset |
| 349 // its height on each bounds change so that it is laid out properly. | 348 // its height on each bounds change so that it is laid out properly. |
| 350 if (separator_) | 349 if (separator_) |
| 351 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); | 350 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); |
| 352 } | 351 } |
| 353 | 352 |
| 354 } // namespace tray | 353 } // namespace tray |
| 355 } // namespace ash | 354 } // namespace ash |
| OLD | NEW |