Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2908)

Unified Diff: ash/system/overview/overview_button_tray.cc

Issue 2807693002: Make LogoutButtonTray a regular View (Closed)
Patch Set: Rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/overview/overview_button_tray.h ('k') | ash/system/palette/palette_tray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d07eeebebdf7ee995ae9f4b2b6cb5ae13e5a2d98..331f445cce85281223718ca4b30916897b308988 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -12,6 +12,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 "ui/base/l10n/l10n_util.h"
@@ -22,13 +23,18 @@
namespace ash {
OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf)
- : TrayBackgroundView(wm_shelf, true),
+ : TrayBackgroundView(wm_shelf),
icon_(new views::ImageView()),
scoped_session_observer_(this) {
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
« no previous file with comments | « ash/system/overview/overview_button_tray.h ('k') | ash/system/palette/palette_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698