| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/system/tray/hover_highlight_view.h" | 5 #include "ash/system/tray/hover_highlight_view.h" |
| 6 | 6 |
| 7 #include "ash/resources/vector_icons/vector_icons.h" | 7 #include "ash/resources/vector_icons/vector_icons.h" |
| 8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
| 9 #include "ash/system/tray/tray_popup_utils.h" | 9 #include "ash/system/tray/tray_popup_utils.h" |
| 10 #include "ash/system/tray/tri_view.h" | 10 #include "ash/system/tray/tri_view.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool HoverHighlightView::PerformAction(const ui::Event& event) { | 189 bool HoverHighlightView::PerformAction(const ui::Event& event) { |
| 190 if (!listener_) | 190 if (!listener_) |
| 191 return false; | 191 return false; |
| 192 listener_->OnViewClicked(this); | 192 listener_->OnViewClicked(this); |
| 193 return true; | 193 return true; |
| 194 } | 194 } |
| 195 | 195 |
| 196 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 196 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 197 ActionableView::GetAccessibleNodeData(node_data); | 197 ActionableView::GetAccessibleNodeData(node_data); |
| 198 | 198 |
| 199 ui::AXCheckedState checked_state; | 199 ui::AXButtonState checked_state; |
| 200 | 200 |
| 201 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) | 201 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) |
| 202 checked_state = ui::AX_CHECKED_STATE_TRUE; | 202 checked_state = ui::AX_BUTTON_STATE_TRUE; |
| 203 else if (accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) | 203 else if (accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) |
| 204 checked_state = ui::AX_CHECKED_STATE_FALSE; | 204 checked_state = ui::AX_BUTTON_STATE_FALSE; |
| 205 else | 205 else |
| 206 return; // Not a checkbox | 206 return; // Not a checkbox |
| 207 | 207 |
| 208 // Checkbox | 208 // Checkbox |
| 209 node_data->role = ui::AX_ROLE_CHECK_BOX; | 209 node_data->role = ui::AX_ROLE_CHECK_BOX; |
| 210 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state); | 210 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state); |
| 211 } | 211 } |
| 212 | 212 |
| 213 gfx::Size HoverHighlightView::CalculatePreferredSize() const { | 213 gfx::Size HoverHighlightView::CalculatePreferredSize() const { |
| 214 gfx::Size size = ActionableView::GetPreferredSize(); | 214 gfx::Size size = ActionableView::GetPreferredSize(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 231 if (right_view_) | 231 if (right_view_) |
| 232 right_view_->SetEnabled(enabled()); | 232 right_view_->SetEnabled(enabled()); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void HoverHighlightView::OnFocus() { | 235 void HoverHighlightView::OnFocus() { |
| 236 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 236 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
| 237 ActionableView::OnFocus(); | 237 ActionableView::OnFocus(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace ash | 240 } // namespace ash |
| OLD | NEW |