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

Unified Diff: ash/common/system/tray_accessibility.cc

Issue 2795143005: [Ash] Remove pre-MD code paths from HoverHighlightView (Closed)
Patch Set: estade 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_accessibility.h ('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 864027dc63ff02330d3c1b9ae269ee90f784e140..47eb8fbf0cf4771ef45b380075233457e690d4b9 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -225,42 +225,36 @@ AccessibilityDetailedView::AccessibilityDetailedView(SystemTrayItem* owner,
void AccessibilityDetailedView::AppendAccessibilityList() {
CreateScrollableList();
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
AccessibilityDelegate* delegate =
Shell::GetInstance()->accessibility_delegate();
spoken_feedback_enabled_ = delegate->IsSpokenFeedbackEnabled();
- spoken_feedback_view_ =
- AddScrollListItem(bundle.GetLocalizedString(
- IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK),
- spoken_feedback_enabled_, spoken_feedback_enabled_,
- kSystemMenuAccessibilityChromevoxIcon);
+ spoken_feedback_view_ = AddScrollListItem(
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK),
+ spoken_feedback_enabled_, kSystemMenuAccessibilityChromevoxIcon);
high_contrast_enabled_ = delegate->IsHighContrastEnabled();
high_contrast_view_ = AddScrollListItem(
- bundle.GetLocalizedString(
+ l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE),
- high_contrast_enabled_, high_contrast_enabled_,
- kSystemMenuAccessibilityContrastIcon);
+ high_contrast_enabled_, kSystemMenuAccessibilityContrastIcon);
screen_magnifier_enabled_ = delegate->IsMagnifierEnabled();
- screen_magnifier_view_ =
- AddScrollListItem(bundle.GetLocalizedString(
- IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER),
- screen_magnifier_enabled_, screen_magnifier_enabled_,
- kSystemMenuAccessibilityScreenMagnifierIcon);
+ screen_magnifier_view_ = AddScrollListItem(
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER),
+ screen_magnifier_enabled_, kSystemMenuAccessibilityScreenMagnifierIcon);
autoclick_enabled_ = delegate->IsAutoclickEnabled();
autoclick_view_ = AddScrollListItem(
- bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_AUTOCLICK),
- autoclick_enabled_, autoclick_enabled_,
- kSystemMenuAccessibilityAutoClickIcon);
+ l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_AUTOCLICK),
+ autoclick_enabled_, kSystemMenuAccessibilityAutoClickIcon);
virtual_keyboard_enabled_ = delegate->IsVirtualKeyboardEnabled();
virtual_keyboard_view_ =
- AddScrollListItem(bundle.GetLocalizedString(
+ AddScrollListItem(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD),
- virtual_keyboard_enabled_, virtual_keyboard_enabled_,
- kSystemMenuKeyboardIcon);
+ virtual_keyboard_enabled_, kSystemMenuKeyboardIcon);
scroll_content()->AddChildView(
TrayPopupUtils::CreateListSubHeaderSeparator());
@@ -270,23 +264,23 @@ void AccessibilityDetailedView::AppendAccessibilityList() {
large_cursor_enabled_ = delegate->IsLargeCursorEnabled();
large_cursor_view_ = AddScrollListItemWithoutIcon(
- bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_LARGE_CURSOR),
+ l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_LARGE_CURSOR),
large_cursor_enabled_);
mono_audio_enabled_ = delegate->IsMonoAudioEnabled();
mono_audio_view_ = AddScrollListItemWithoutIcon(
- bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_MONO_AUDIO),
+ l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_MONO_AUDIO),
mono_audio_enabled_);
caret_highlight_enabled_ = delegate->IsCaretHighlightEnabled();
caret_highlight_view_ = AddScrollListItemWithoutIcon(
- bundle.GetLocalizedString(
+ l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_CARET_HIGHLIGHT),
caret_highlight_enabled_);
highlight_mouse_cursor_enabled_ = delegate->IsCursorHighlightEnabled();
highlight_mouse_cursor_view_ = AddScrollListItemWithoutIcon(
- bundle.GetLocalizedString(
+ l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGHLIGHT_MOUSE_CURSOR),
highlight_mouse_cursor_enabled_);
@@ -295,7 +289,7 @@ void AccessibilityDetailedView::AppendAccessibilityList() {
if (!spoken_feedback_enabled_) {
highlight_keyboard_focus_enabled_ = delegate->IsFocusHighlightEnabled();
highlight_keyboard_focus_view_ = AddScrollListItemWithoutIcon(
- bundle.GetLocalizedString(
+ l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGHLIGHT_KEYBOARD_FOCUS),
highlight_keyboard_focus_enabled_);
}
@@ -303,18 +297,12 @@ void AccessibilityDetailedView::AppendAccessibilityList() {
HoverHighlightView* AccessibilityDetailedView::AddScrollListItem(
const base::string16& text,
- bool highlight,
bool checked,
const gfx::VectorIcon& icon) {
HoverHighlightView* container = new HoverHighlightView(this);
gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor);
- const int padding = (kMenuButtonSize - image.width()) / 2;
- container->AddIconAndLabelCustomSize(
- image, text, highlight, image.width() + kMenuSeparatorVerticalPadding * 2,
- padding, padding);
-
+ container->AddIconAndLabel(image, text);
UpdateCheckMark(container, checked);
-
scroll_content()->AddChildView(container);
return container;
}
@@ -323,7 +311,7 @@ HoverHighlightView* AccessibilityDetailedView::AddScrollListItemWithoutIcon(
const base::string16& text,
bool checked) {
HoverHighlightView* container = new HoverHighlightView(this);
- container->AddLabelRowMd(text);
+ container->AddLabelRow(text);
UpdateCheckMark(container, checked);
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698