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

Unified Diff: ash/common/system/chromeos/palette/common_palette_tool.cc

Issue 2343603003: [Chrome OS MD] Implement accessibility detailed view for the MD Ash system menu (Closed)
Patch Set: address comments Created 4 years, 3 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
Index: ash/common/system/chromeos/palette/common_palette_tool.cc
diff --git a/ash/common/system/chromeos/palette/common_palette_tool.cc b/ash/common/system/chromeos/palette/common_palette_tool.cc
index fbad6311ffbdac17640b81e6be3a1d4dd702f717..7e47d356ad84de406eb39503ddbcc436d78aedf9 100644
--- a/ash/common/system/chromeos/palette/common_palette_tool.cc
+++ b/ash/common/system/chromeos/palette/common_palette_tool.cc
@@ -8,6 +8,7 @@
#include "ash/common/system/chromeos/palette/palette_ids.h"
#include "ash/common/system/chromeos/palette/palette_tool_manager.h"
#include "ash/common/system/tray/hover_highlight_view.h"
+#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/view_click_listener.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -22,18 +23,6 @@
namespace ash {
namespace {
-// Size of the icons in DP.
-const int kIconSize = 20;
-
-// Distance between the icon and the check from the egdes in DP.
-const int kMarginFromEdges = 14;
-
-// Extra distance between the icon and the left edge in DP.
-const int kExtraMarginFromLeftEdge = 4;
-
-// Distance between the icon and the name of the tool in DP.
-const int kMarginBetweenIconAndText = 18;
-
void AddHistogramTimes(PaletteToolId id, base::TimeDelta duration) {
if (id == PaletteToolId::LASER_POINTER) {
UMA_HISTOGRAM_CUSTOM_TIMES("Ash.Shelf.Palette.InLaserPointerMode", duration,
@@ -98,17 +87,18 @@ void CommonPaletteTool::OnViewClicked(views::View* sender) {
views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
gfx::ImageSkia icon =
- CreateVectorIcon(GetPaletteIcon(), kIconSize, gfx::kChromeIconGrey);
+ CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, gfx::kChromeIconGrey);
gfx::ImageSkia check = CreateVectorIcon(gfx::VectorIconId::CHECK_CIRCLE,
- kIconSize, gfx::kGoogleGreen700);
+ kMenuIconSize, gfx::kGoogleGreen700);
highlight_view_ = new HoverHighlightView(this);
highlight_view_->SetBorder(
- views::Border::CreateEmptyBorder(0, kExtraMarginFromLeftEdge, 0, 0));
- highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kIconSize,
- kMarginFromEdges,
- kMarginBetweenIconAndText);
- highlight_view_->AddRightIcon(check, kIconSize);
+ views::Border::CreateEmptyBorder(0, kMenuIconMargin, 0, 0));
+ const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2;
+ highlight_view_->AddIconAndLabelCustomSize(
+ icon, name, false, kMenuIconSize, interior_button_padding,
+ interior_button_padding + kMenuIconMargin);
+ highlight_view_->AddRightIcon(check, kMenuIconSize);
if (enabled())
highlight_view_->SetHighlight(true);

Powered by Google App Engine
This is Rietveld 408576698