Chromium Code Reviews| Index: ash/system/overview/overview_button_tray.cc |
| diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc |
| index 4b152b3be601271554d1897d874d83b6f65d3768..043ea9c81a8254e394bfc01b42a4c5317c212a73 100644 |
| --- a/ash/system/overview/overview_button_tray.cc |
| +++ b/ash/system/overview/overview_button_tray.cc |
| @@ -4,11 +4,14 @@ |
| #include "ash/system/overview/overview_button_tray.h" |
| +#include "ash/material_design/material_design_controller.h" |
| #include "ash/session/session_state_delegate.h" |
| +#include "ash/shelf/shelf_constants.h" |
| #include "ash/shelf/shelf_types.h" |
| #include "ash/shelf/shelf_util.h" |
| #include "ash/shell.h" |
| #include "ash/system/tray/system_tray_delegate.h" |
| +#include "ash/system/tray/tray_constants.h" |
| #include "ash/system/tray/tray_utils.h" |
| #include "ash/wm/common/shelf/wm_shelf_util.h" |
| #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| @@ -104,6 +107,27 @@ void OverviewButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { |
| SetIconBorderForShelfAlignment(); |
| } |
| +void OverviewButtonTray::GetHitRegionInsets(gfx::Insets& insets) { |
| + if (ash::MaterialDesignController::IsShelfMaterial()) { |
| + int top_edge, left_edge, bottom_edge, right_edge; |
| + if (wm::IsHorizontalAlignment(shelf_alignment())) { |
| + top_edge = (GetShelfLayoutConstant(SHELF_SIZE) - kShelfItemHeight) / 2; |
| + left_edge = 0; |
| + bottom_edge = (GetShelfLayoutConstant(SHELF_SIZE) - kShelfItemHeight) / 2; |
| + right_edge = GetTrayConstant(PADDING_FROM_EDGE_OF_SHELF); |
| + } else { // SHELF_ALIGNMENT_LEFT || SHELF_ALIGNMENT_RIGHT |
| + top_edge = 0; |
| + left_edge = (GetShelfLayoutConstant(SHELF_SIZE) - kShelfItemHeight) / 2; |
| + bottom_edge = GetTrayConstant(PADDING_FROM_EDGE_OF_SHELF); |
| + right_edge = (GetShelfLayoutConstant(SHELF_SIZE) - kShelfItemHeight) / 2; |
| + } |
| + insets.Set(top_edge, left_edge, bottom_edge, right_edge); |
| + } else { |
| + TrayBackgroundView::GetHitRegionInsets(insets); |
| + } |
| +} |
| + |
| +// TODO(yiyix): Remove the 3dp border around the button. |
|
tdanderson
2016/06/03 19:25:23
Move to TrayContainer, reword to be something like
yiyix
2016/06/10 19:26:04
Done.
|
| void OverviewButtonTray::SetIconBorderForShelfAlignment() { |
| if (wm::IsHorizontalAlignment(shelf_alignment())) { |
| icon_->SetBorder(views::Border::CreateEmptyBorder( |