| 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_item_more.h" | 5 #include "ash/common/system/tray/tray_item_more.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/system/tray/system_tray_item.h" | 8 #include "ash/common/system/tray/system_tray_item.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_popup_item_style.h" | 10 #include "ash/common/system/tray/tray_popup_item_style.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 void TrayItemMore::UpdateStyle() { | 82 void TrayItemMore::UpdateStyle() { |
| 83 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) | 83 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) |
| 84 return; | 84 return; |
| 85 std::unique_ptr<TrayPopupItemStyle> style = CreateStyle(); | 85 std::unique_ptr<TrayPopupItemStyle> style = CreateStyle(); |
| 86 style->SetupLabel(label_); | 86 style->SetupLabel(label_); |
| 87 | 87 |
| 88 if (more_) { | 88 if (more_) { |
| 89 more_->SetImage(gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, | 89 more_->SetImage(gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, |
| 90 style->GetForegroundColor())); | 90 style->GetIconColor())); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool TrayItemMore::PerformAction(const ui::Event& event) { | 94 bool TrayItemMore::PerformAction(const ui::Event& event) { |
| 95 if (!show_more_) | 95 if (!show_more_) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 owner()->TransitionDetailedView(); | 98 owner()->TransitionDetailedView(); |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void TrayItemMore::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 102 void TrayItemMore::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 103 ActionableView::GetAccessibleNodeData(node_data); | 103 ActionableView::GetAccessibleNodeData(node_data); |
| 104 if (!accessible_name_.empty()) | 104 if (!accessible_name_.empty()) |
| 105 node_data->SetName(accessible_name_); | 105 node_data->SetName(accessible_name_); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void TrayItemMore::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 108 void TrayItemMore::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| 109 ActionableView::OnNativeThemeChanged(theme); | 109 ActionableView::OnNativeThemeChanged(theme); |
| 110 UpdateStyle(); | 110 UpdateStyle(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace ash | 113 } // namespace ash |
| OLD | NEW |