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

Unified Diff: ash/common/system/tray/tray_utils.cc

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Rename CheckMark -> SetCheckMarkVisible, UncheckMark -> SetCheckMarkInvisible. Update the comment. 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/tray/tray_utils.cc
diff --git a/ash/common/system/tray/tray_utils.cc b/ash/common/system/tray/tray_utils.cc
index 28299cc66e645f8aec1284a1fa6e5c8661a6dda9..83fa10c1fb04288434bd9e93b1686f240e8e357a 100644
--- a/ash/common/system/tray/tray_utils.cc
+++ b/ash/common/system/tray/tray_utils.cc
@@ -4,7 +4,11 @@
#include "ash/common/system/tray/tray_utils.h"
+#include "ash/common/system/tray/hover_highlight_view.h"
+#include "ash/resources/vector_icons/vector_icons.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h"
+#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/label.h"
namespace ash {
@@ -17,4 +21,19 @@ void SetupLabelForTray(views::Label* label) {
gfx::FontList().Derive(2, gfx::Font::NORMAL, gfx::Font::Weight::MEDIUM));
}
+void SetCheckMarkVisible(HoverHighlightView* container) {
+ gfx::ImageSkia check_mark =
+ CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700);
+ container->AddRightIcon(check_mark, check_mark.width());
+ container->SetRightViewVisible(true);
+ container->SetAccessiblityState(
+ HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
+}
+
+void SetCheckMarkInvisible(HoverHighlightView* container) {
+ container->SetRightViewVisible(false);
+ container->SetAccessiblityState(
+ HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
tdanderson 2017/04/06 17:52:09 The two new functions you have introduced here are
minch1 2017/04/06 18:05:47 The logic of enable and disable check mark in Comm
minch1 2017/04/06 18:09:41 Maybe I can add one more function here to combine
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698