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/common/system/tray/hover_highlight_view.h" | 5 #include "ash/common/system/tray/hover_highlight_view.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/fixed_sized_image_view.h" | 8 #include "ash/common/system/tray/fixed_sized_image_view.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_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 322 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
323 ActionableView::GetAccessibleNodeData(node_data); | 323 ActionableView::GetAccessibleNodeData(node_data); |
324 | 324 |
325 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX || | 325 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX || |
326 accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) { | 326 accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) { |
327 node_data->role = ui::AX_ROLE_CHECK_BOX; | 327 node_data->role = ui::AX_ROLE_CHECK_BOX; |
328 } | 328 } |
329 | 329 |
330 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) | 330 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) |
331 node_data->AddStateFlag(ui::AX_STATE_CHECKED); | 331 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
| 332 ui::AX_CHECKED_STATE_TRUE); |
332 } | 333 } |
333 | 334 |
334 gfx::Size HoverHighlightView::GetPreferredSize() const { | 335 gfx::Size HoverHighlightView::GetPreferredSize() const { |
335 gfx::Size size = ActionableView::GetPreferredSize(); | 336 gfx::Size size = ActionableView::GetPreferredSize(); |
336 | 337 |
337 if (custom_height_) | 338 if (custom_height_) |
338 size.set_height(custom_height_); | 339 size.set_height(custom_height_); |
339 else if (!expandable_ || size.height() < kTrayPopupItemMinHeight) | 340 else if (!expandable_ || size.height() < kTrayPopupItemMinHeight) |
340 size.set_height(kTrayPopupItemMinHeight); | 341 size.set_height(kTrayPopupItemMinHeight); |
341 | 342 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 388 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
388 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 389 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
389 } | 390 } |
390 | 391 |
391 void HoverHighlightView::OnFocus() { | 392 void HoverHighlightView::OnFocus() { |
392 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 393 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
393 ActionableView::OnFocus(); | 394 ActionableView::OnFocus(); |
394 } | 395 } |
395 | 396 |
396 } // namespace ash | 397 } // namespace ash |
OLD | NEW |