| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "ash/system/user/button_from_view.h" | 7 #include "ash/system/user/button_from_view.h" |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Removing focus frame. | 72 // Removing focus frame. |
| 73 SchedulePaint(); | 73 SchedulePaint(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void ButtonFromView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 76 void ButtonFromView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 77 views::CustomButton::GetAccessibleNodeData(node_data); | 77 views::CustomButton::GetAccessibleNodeData(node_data); |
| 78 // If no label has been explicitly set via CustomButton::SetAccessibleName(), | 78 // If no label has been explicitly set via CustomButton::SetAccessibleName(), |
| 79 // use the content's label. | 79 // use the content's label. |
| 80 if (node_data->GetStringAttribute(ui::AX_ATTR_NAME).empty()) { | 80 if (node_data->GetStringAttribute(ui::AX_ATTR_NAME).empty()) { |
| 81 ui::AXNodeData content_data; | 81 ui::AXNodeData content_data; |
| 82 content_data.ClearBitfields(); |
| 82 content_->GetAccessibleNodeData(&content_data); | 83 content_->GetAccessibleNodeData(&content_data); |
| 83 node_data->SetName(content_data.GetStringAttribute(ui::AX_ATTR_NAME)); | 84 node_data->SetName(content_data.GetStringAttribute(ui::AX_ATTR_NAME)); |
| 84 } | 85 } |
| 85 } | 86 } |
| 86 | 87 |
| 87 void ButtonFromView::Layout() { | 88 void ButtonFromView::Layout() { |
| 88 CustomButton::Layout(); | 89 CustomButton::Layout(); |
| 89 if (ink_drop_container_) | 90 if (ink_drop_container_) |
| 90 ink_drop_container_->SetBoundsRect(GetLocalBounds()); | 91 ink_drop_container_->SetBoundsRect(GetLocalBounds()); |
| 91 } | 92 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 ButtonFromView::CreateInkDropHighlight() const { | 125 ButtonFromView::CreateInkDropHighlight() const { |
| 125 return TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this); | 126 return TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this); |
| 126 } | 127 } |
| 127 | 128 |
| 128 std::unique_ptr<views::InkDropMask> ButtonFromView::CreateInkDropMask() const { | 129 std::unique_ptr<views::InkDropMask> ButtonFromView::CreateInkDropMask() const { |
| 129 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); | 130 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace tray | 133 } // namespace tray |
| 133 } // namespace ash | 134 } // namespace ash |
| OLD | NEW |