| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 more_arrow->SetImage(ui::ResourceBundle::GetSharedInstance() | 197 more_arrow->SetImage(ui::ResourceBundle::GetSharedInstance() |
| 198 .GetImageNamed(IDR_AURA_UBER_TRAY_MORE) | 198 .GetImageNamed(IDR_AURA_UBER_TRAY_MORE) |
| 199 .ToImageSkia()); | 199 .ToImageSkia()); |
| 200 } | 200 } |
| 201 more_button_->AddChildView(more_arrow); | 201 more_button_->AddChildView(more_arrow); |
| 202 | 202 |
| 203 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 203 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 204 more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); | 204 more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); |
| 205 tri_view_->AddView(TriView::Container::END, more_button_); | 205 tri_view_->AddView(TriView::Container::END, more_button_); |
| 206 } else { | 206 } else { |
| 207 separator_ = new views::Separator(views::Separator::VERTICAL); | 207 separator_ = new views::Separator(); |
| 208 separator_->SetColor(kButtonStrokeColor); | 208 separator_->SetColor(kButtonStrokeColor); |
| 209 separator_->SetPreferredSize(kSeparatorSize); | |
| 210 separator_->SetBorder(views::CreateEmptyBorder(kSeparatorVerticalInset, 0, | 209 separator_->SetBorder(views::CreateEmptyBorder(kSeparatorVerticalInset, 0, |
| 211 kSeparatorVerticalInset, | 210 kSeparatorVerticalInset, |
| 212 kBoxLayoutPadding)); | 211 kBoxLayoutPadding)); |
| 213 | 212 |
| 214 TrayPopupItemContainer* more_container = | 213 TrayPopupItemContainer* more_container = |
| 215 new TrayPopupItemContainer(separator_, true); | 214 new TrayPopupItemContainer(separator_, true); |
| 216 more_container->SetLayoutManager( | 215 more_container->SetLayoutManager( |
| 217 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 216 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
| 218 more_container->AddChildView(more_button_); | 217 more_container->AddChildView(more_button_); |
| 219 tri_view_->AddView(TriView::Container::END, more_container); | 218 tri_view_->AddView(TriView::Container::END, more_container); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 344 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 346 // Separator's prefered size is based on set bounds. When an empty bounds is | 345 // Separator's prefered size is based on set bounds. When an empty bounds is |
| 347 // set on first layout this causes BoxLayout to ignore the separator. Reset | 346 // set on first layout this causes BoxLayout to ignore the separator. Reset |
| 348 // its height on each bounds change so that it is laid out properly. | 347 // its height on each bounds change so that it is laid out properly. |
| 349 if (separator_) | 348 if (separator_) |
| 350 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); | 349 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); |
| 351 } | 350 } |
| 352 | 351 |
| 353 } // namespace tray | 352 } // namespace tray |
| 354 } // namespace ash | 353 } // namespace ash |
| OLD | NEW |