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

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

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Address the comments on PS#6 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_popup_utils.cc
diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc
index 98e9fdba649ad5ffd1d780d4afe582444fc3a423..56e0e68d237c81045c8872f6642193f71f608b45 100644
--- a/ash/common/system/tray/tray_popup_utils.cc
+++ b/ash/common/system/tray/tray_popup_utils.cc
@@ -11,6 +11,7 @@
#include "ash/common/ash_view_ids.h"
#include "ash/common/session/session_controller.h"
#include "ash/common/system/tray/fixed_sized_image_view.h"
+#include "ash/common/system/tray/hover_highlight_view.h"
#include "ash/common/system/tray/size_range_layout.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_item_style.h"
@@ -18,6 +19,7 @@
#include "ash/shell.h"
#include "base/memory/ptr_util.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h"
@@ -434,4 +436,20 @@ bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) {
!Shell::Get()->session_controller()->IsInSecondaryLoginScreen();
}
+void TrayPopupUtils::InitializeAsCheckableRow(HoverHighlightView* container,
+ bool checked) {
+ gfx::ImageSkia check_mark =
+ CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700);
tdanderson 2017/04/07 20:57:31 Regarding the "Note" you made in the CL descriptio
+ container->AddRightIcon(check_mark, check_mark.width());
+ UpdateCheckMarkVisibility(container, checked);
+}
+
+void TrayPopupUtils::UpdateCheckMarkVisibility(HoverHighlightView* container,
+ bool visible) {
+ container->SetRightViewVisible(visible);
+ container->SetAccessiblityState(
+ visible ? HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX
+ : HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698