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

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

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Reuse the code within UpdateCheckMark(). 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
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 b8a049304877eb42f6ab14c345e88f66f0480563..34b8c96ffa5805fd957cea1c934b1a9aa669411d 100644
--- a/ash/common/system/chromeos/palette/common_palette_tool.cc
+++ b/ash/common/system/chromeos/palette/common_palette_tool.cc
@@ -9,6 +9,7 @@
#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/tray_popup_utils.h"
#include "ash/common/system/tray/view_click_listener.h"
#include "ash/resources/grit/ash_resources.h"
#include "ash/resources/vector_icons/vector_icons.h"
@@ -85,23 +86,13 @@ void CommonPaletteTool::OnViewClicked(views::View* sender) {
views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
gfx::ImageSkia icon =
CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, gfx::kChromeIconGrey);
- gfx::ImageSkia check =
- CreateVectorIcon(kCheckCircleIcon, kMenuIconSize, gfx::kGoogleGreen700);
highlight_view_ = new HoverHighlightView(this);
highlight_view_->SetBorder(views::CreateEmptyBorder(0, 0, 0, 0));
highlight_view_->AddIconAndLabel(icon, name);
- highlight_view_->AddRightIcon(check, kMenuIconSize);
highlight_view_->set_custom_height(kMenuButtonSize);
- if (enabled()) {
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
- } else {
- highlight_view_->SetRightViewVisible(false);
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
- }
+ TrayPopupUtils::UpdateCheckMarkVisibility(highlight_view_, enabled());
return highlight_view_;
}

Powered by Google App Engine
This is Rietveld 408576698