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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) { | 366 accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) { |
367 node_data->role = ui::AX_ROLE_CHECK_BOX; | 367 node_data->role = ui::AX_ROLE_CHECK_BOX; |
368 } | 368 } |
369 | 369 |
370 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) | 370 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) |
371 node_data->AddStateFlag(ui::AX_STATE_CHECKED); | 371 node_data->AddStateFlag(ui::AX_STATE_CHECKED); |
372 } | 372 } |
373 | 373 |
374 gfx::Size HoverHighlightView::GetPreferredSize() const { | 374 gfx::Size HoverHighlightView::GetPreferredSize() const { |
375 gfx::Size size = ActionableView::GetPreferredSize(); | 375 gfx::Size size = ActionableView::GetPreferredSize(); |
376 const int default_height = GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT); | 376 const int default_height = kTrayPopupItemMinHeight; |
tdanderson
2017/02/28 17:08:18
nit: local variable not needed
Evan Stade
2017/03/01 04:28:54
Done.
| |
377 | 377 |
378 if (custom_height_) | 378 if (custom_height_) |
379 size.set_height(custom_height_); | 379 size.set_height(custom_height_); |
380 else if (!expandable_ || size.height() < default_height) | 380 else if (!expandable_ || size.height() < default_height) |
381 size.set_height(default_height); | 381 size.set_height(default_height); |
382 | 382 |
383 return size; | 383 return size; |
384 } | 384 } |
385 | 385 |
386 int HoverHighlightView::GetHeightForWidth(int width) const { | 386 int HoverHighlightView::GetHeightForWidth(int width) const { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 428 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
429 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 429 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
430 } | 430 } |
431 | 431 |
432 void HoverHighlightView::OnFocus() { | 432 void HoverHighlightView::OnFocus() { |
433 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 433 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
434 ActionableView::OnFocus(); | 434 ActionableView::OnFocus(); |
435 } | 435 } |
436 | 436 |
437 } // namespace ash | 437 } // namespace ash |
OLD | NEW |