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

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

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Update comments. 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/common/system/tray/tray_popup_utils.h ('k') | ash/common/system/tray_accessibility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ 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
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.h ('k') | ash/common/system/tray_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698