| 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/audio/volume_view.h" | 5 #include "ash/common/system/audio/volume_view.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/metrics/user_metrics_action.h" | 9 #include "ash/common/metrics/user_metrics_action.h" |
| 10 #include "ash/common/system/audio/tray_audio.h" | 10 #include "ash/common/system/audio/tray_audio.h" |
| 11 #include "ash/common/system/audio/tray_audio_delegate.h" | 11 #include "ash/common/system/audio/tray_audio_delegate.h" |
| 12 #include "ash/common/system/tray/system_tray_item.h" | 12 #include "ash/common/system/tray/system_tray_item.h" |
| 13 #include "ash/common/system/tray/tray_constants.h" | 13 #include "ash/common/system/tray/tray_constants.h" |
| 14 #include "ash/common/system/tray/tray_popup_item_container.h" | 14 #include "ash/common/system/tray/tray_popup_item_container.h" |
| 15 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 16 #include "ash/resources/vector_icons/vector_icons.h" |
| 16 #include "grit/ash_resources.h" | 17 #include "grit/ash_resources.h" |
| 17 #include "grit/ash_strings.h" | 18 #include "grit/ash_strings.h" |
| 18 #include "ui/accessibility/ax_view_state.h" | 19 #include "ui/accessibility/ax_view_state.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
| 21 #include "ui/gfx/image/image_skia_operations.h" | 22 #include "ui/gfx/image/image_skia_operations.h" |
| 22 #include "ui/gfx/paint_vector_icon.h" | 23 #include "ui/gfx/paint_vector_icon.h" |
| 23 #include "ui/gfx/vector_icons_public.h" | |
| 24 #include "ui/views/background.h" | 24 #include "ui/views/background.h" |
| 25 #include "ui/views/border.h" | 25 #include "ui/views/border.h" |
| 26 #include "ui/views/controls/button/image_button.h" | 26 #include "ui/views/controls/button/image_button.h" |
| 27 #include "ui/views/controls/image_view.h" | 27 #include "ui/views/controls/image_view.h" |
| 28 #include "ui/views/controls/separator.h" | 28 #include "ui/views/controls/separator.h" |
| 29 #include "ui/views/layout/box_layout.h" | 29 #include "ui/views/layout/box_layout.h" |
| 30 #include "ui/views/painter.h" | 30 #include "ui/views/painter.h" |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 const int kVolumeImageWidth = 25; | 33 const int kVolumeImageWidth = 25; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 views::Border::CreateEmptyBorder(0, 0, 0, kTrayPopupPaddingBetweenItems)); | 163 views::Border::CreateEmptyBorder(0, 0, 0, kTrayPopupPaddingBetweenItems)); |
| 164 AddChildView(more_region_); | 164 AddChildView(more_region_); |
| 165 | 165 |
| 166 device_type_ = new views::ImageView; | 166 device_type_ = new views::ImageView; |
| 167 more_region_->AddChildView(device_type_); | 167 more_region_->AddChildView(device_type_); |
| 168 | 168 |
| 169 more_ = new views::ImageView; | 169 more_ = new views::ImageView; |
| 170 more_->EnableCanvasFlippingForRTLUI(true); | 170 more_->EnableCanvasFlippingForRTLUI(true); |
| 171 | 171 |
| 172 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 172 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 173 more_->SetImage(gfx::CreateVectorIcon( | 173 more_->SetImage( |
| 174 gfx::VectorIconId::SYSTEM_MENU_ARROW_RIGHT, kMenuIconColor)); | 174 gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor)); |
| 175 } else { | 175 } else { |
| 176 more_->SetImage(ui::ResourceBundle::GetSharedInstance() | 176 more_->SetImage(ui::ResourceBundle::GetSharedInstance() |
| 177 .GetImageNamed(IDR_AURA_UBER_TRAY_MORE) | 177 .GetImageNamed(IDR_AURA_UBER_TRAY_MORE) |
| 178 .ToImageSkia()); | 178 .ToImageSkia()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 more_region_->AddChildView(more_); | 181 more_region_->AddChildView(more_); |
| 182 | 182 |
| 183 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); | 183 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); |
| 184 | 184 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); | 303 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void VolumeView::GetAccessibleState(ui::AXViewState* state) { | 306 void VolumeView::GetAccessibleState(ui::AXViewState* state) { |
| 307 // Intentionally overrides ActionableView, leaving |state| unset. A slider | 307 // Intentionally overrides ActionableView, leaving |state| unset. A slider |
| 308 // childview exposes accessibility data. | 308 // childview exposes accessibility data. |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace tray | 311 } // namespace tray |
| 312 } // namespace ash | 312 } // namespace ash |
| OLD | NEW |