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

Unified Diff: ash/common/system/tray_accessibility.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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray_accessibility.cc
diff --git a/ash/common/system/tray_accessibility.cc b/ash/common/system/tray_accessibility.cc
index 3d32c7a57d37432431a43fa19c0ab44f6ba91269..b5bb9a14437ea0d59ac72f58e96f195b20e0e646 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -25,7 +25,6 @@
#include "base/strings/utf_string_conversions.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/color_palette.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/resources/grit/ui_resources.h"
@@ -88,20 +87,6 @@ LoginStatus GetCurrentLoginStatus() {
return Shell::Get()->system_tray_delegate()->GetUserLoginStatus();
}
-void UpdateCheckMark(HoverHighlightView* container, bool checked) {
- if (checked) {
- gfx::ImageSkia check_mark =
- CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700);
- container->AddRightIcon(check_mark, check_mark.width());
- container->SetRightViewVisible(true);
- container->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
- } else {
- container->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
- }
-}
-
} // namespace
namespace tray {
@@ -300,7 +285,7 @@ HoverHighlightView* AccessibilityDetailedView::AddScrollListItem(
HoverHighlightView* container = new HoverHighlightView(this);
gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor);
container->AddIconAndLabel(image, text);
- UpdateCheckMark(container, checked);
+ TrayPopupUtils::InitializeAsCheckableRow(container, checked);
scroll_content()->AddChildView(container);
return container;
}
@@ -310,9 +295,7 @@ HoverHighlightView* AccessibilityDetailedView::AddScrollListItemWithoutIcon(
bool checked) {
HoverHighlightView* container = new HoverHighlightView(this);
container->AddLabelRow(text);
-
- UpdateCheckMark(container, checked);
-
+ TrayPopupUtils::InitializeAsCheckableRow(container, checked);
scroll_content()->AddChildView(container);
return container;
}
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698