| 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 2eb54f7983ed25362c1bf581200ae986fd8efcc7..a64a9ea3eef5e9ce968751a0098a898bff5bc197 100644
|
| --- a/ash/system/overview/overview_button_tray.cc
|
| +++ b/ash/system/overview/overview_button_tray.cc
|
| @@ -11,6 +11,7 @@
|
| #include "ash/strings/grit/ash_strings.h"
|
| #include "ash/system/tray/system_tray_delegate.h"
|
| #include "ash/system/tray/tray_constants.h"
|
| +#include "ash/system/tray/tray_container.h"
|
| #include "ash/wm/maximize_mode/maximize_mode_controller.h"
|
| #include "ash/wm/overview/window_selector_controller.h"
|
| #include "ash/wm_shell.h"
|
| @@ -22,11 +23,16 @@
|
| namespace ash {
|
|
|
| OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf)
|
| - : TrayBackgroundView(wm_shelf, true), icon_(new views::ImageView()) {
|
| + : TrayBackgroundView(wm_shelf), icon_(new views::ImageView()) {
|
| SetInkDropMode(InkDropMode::ON);
|
|
|
| - icon_->SetImage(CreateVectorIcon(kShelfOverviewIcon, kShelfIconColor));
|
| - SetIconBorderForShelfAlignment();
|
| + gfx::ImageSkia image =
|
| + gfx::CreateVectorIcon(kShelfOverviewIcon, kShelfIconColor);
|
| + icon_->SetImage(image);
|
| + const int vertical_padding = (kTrayItemSize - image.height()) / 2;
|
| + const int horizontal_padding = (kTrayItemSize - image.width()) / 2;
|
| + icon_->SetBorder(views::CreateEmptyBorder(
|
| + gfx::Insets(vertical_padding, horizontal_padding)));
|
| tray_container()->AddChildView(icon_);
|
|
|
| // Since OverviewButtonTray is located on the rightmost position of a
|
| @@ -87,23 +93,6 @@ void OverviewButtonTray::HideBubbleWithView(
|
| // This class has no bubbles to hide.
|
| }
|
|
|
| -void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) {
|
| - if (alignment == shelf_alignment())
|
| - return;
|
| -
|
| - TrayBackgroundView::SetShelfAlignment(alignment);
|
| - SetIconBorderForShelfAlignment();
|
| -}
|
| -
|
| -void OverviewButtonTray::SetIconBorderForShelfAlignment() {
|
| - // Pad button size to align with other controls in the system tray.
|
| - const gfx::ImageSkia& image = icon_->GetImage();
|
| - const int vertical_padding = (kTrayItemSize - image.height()) / 2;
|
| - const int horizontal_padding = (kTrayItemSize - image.width()) / 2;
|
| - icon_->SetBorder(views::CreateEmptyBorder(
|
| - gfx::Insets(vertical_padding, horizontal_padding)));
|
| -}
|
| -
|
| void OverviewButtonTray::UpdateIconVisibility() {
|
| // The visibility of the OverviewButtonTray has diverged from
|
| // WindowSelectorController::CanSelect. The visibility of the button should
|
|
|