| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Maps a non-MD PNG resource id to its corresponding MD vector icon. | 25 // Maps a non-MD PNG resource id to its corresponding MD vector icon. |
| 26 // TODO(tdanderson): Remove this once material design is enabled by | 26 // TODO(tdanderson): Remove this once material design is enabled by |
| 27 // default. See crbug.com/614453. | 27 // default. See crbug.com/614453. |
| 28 const gfx::VectorIcon& ResourceIdToVectorIcon(int resource_id) { | 28 const gfx::VectorIcon& ResourceIdToVectorIcon(int resource_id) { |
| 29 switch (resource_id) { | 29 switch (resource_id) { |
| 30 case IDR_AURA_UBER_TRAY_ACCESSIBILITY: | 30 case IDR_AURA_UBER_TRAY_ACCESSIBILITY: |
| 31 return kSystemTrayAccessibilityIcon; | 31 return kSystemTrayAccessibilityIcon; |
| 32 case IDR_AURA_UBER_TRAY_UPDATE: | |
| 33 return kSystemTrayUpdateIcon; | |
| 34 case IDR_AURA_UBER_TRAY_VOLUME_MUTE: | |
| 35 return kSystemTrayVolumeMuteIcon; | |
| 36 #if defined(OS_CHROMEOS) | |
| 37 case IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED: | 32 case IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED: |
| 38 return kSystemTrayRotationLockLockedIcon; | 33 return kSystemTrayRotationLockLockedIcon; |
| 39 case IDR_AURA_UBER_TRAY_CAPS_LOCK: | 34 case IDR_AURA_UBER_TRAY_CAPS_LOCK: |
| 40 return kSystemTrayCapsLockIcon; | 35 return kSystemTrayCapsLockIcon; |
| 41 case IDR_AURA_UBER_TRAY_TRACING: | 36 case IDR_AURA_UBER_TRAY_TRACING: |
| 42 return kSystemTrayTracingIcon; | 37 return kSystemTrayTracingIcon; |
| 43 #endif | 38 case IDR_AURA_UBER_TRAY_UPDATE: |
| 39 return kSystemTrayUpdateIcon; |
| 40 case IDR_AURA_UBER_TRAY_VOLUME_MUTE: |
| 41 return kSystemTrayVolumeMuteIcon; |
| 44 default: | 42 default: |
| 45 NOTREACHED(); | 43 NOTREACHED(); |
| 46 break; | 44 break; |
| 47 } | 45 } |
| 48 | 46 |
| 49 return gfx::kNoneIcon; | 47 return gfx::kNoneIcon; |
| 50 } | 48 } |
| 51 | 49 |
| 52 } // namespace | 50 } // namespace |
| 53 | 51 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 tray_view_->image_view()->SetImage(gfx::CreateVectorIcon( | 112 tray_view_->image_view()->SetImage(gfx::CreateVectorIcon( |
| 115 ResourceIdToVectorIcon(resource_id_), kTrayIconSize, icon_color_)); | 113 ResourceIdToVectorIcon(resource_id_), kTrayIconSize, icon_color_)); |
| 116 } else { | 114 } else { |
| 117 tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() | 115 tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() |
| 118 .GetImageNamed(resource_id_) | 116 .GetImageNamed(resource_id_) |
| 119 .ToImageSkia()); | 117 .ToImageSkia()); |
| 120 } | 118 } |
| 121 } | 119 } |
| 122 | 120 |
| 123 } // namespace ash | 121 } // namespace ash |
| OLD | NEW |