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

Unified Diff: ash/system/night_light/night_light_toggle_button.cc

Issue 2965163002: [Night Light] Accessibility: Make ChromeVox speak button status on toggles (Closed)
Patch Set: Rebase Created 3 years, 5 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/system/night_light/night_light_toggle_button.h ('k') | ash/system/tiles/tiles_default_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/night_light/night_light_toggle_button.cc
diff --git a/ash/system/night_light/night_light_toggle_button.cc b/ash/system/night_light/night_light_toggle_button.cc
index 231d6557b9563bd5536ecc923f0f6d550ad75458..74b0d451e4b2738ee2641405a0b8851cfb8aa423 100644
--- a/ash/system/night_light/night_light_toggle_button.cc
+++ b/ash/system/night_light/night_light_toggle_button.cc
@@ -9,6 +9,7 @@
#include "ash/system/night_light/night_light_controller.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_item_style.h"
+#include "ui/accessibility/ax_enums.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
@@ -54,6 +55,13 @@ NightLightToggleButton::NightLightToggleButton(views::ButtonListener* listener)
Update();
}
+void NightLightToggleButton::Toggle() {
+ DCHECK(NightLightController::IsFeatureEnabled());
+ Shell::Get()->night_light_controller()->Toggle();
+ Update();
+ NotifyAccessibilityEvent(ui::AX_EVENT_ARIA_ATTRIBUTE_CHANGED, true);
+}
+
void NightLightToggleButton::Update() {
const bool night_light_enabled =
Shell::Get()->night_light_controller()->GetEnabled();
« no previous file with comments | « ash/system/night_light/night_light_toggle_button.h ('k') | ash/system/tiles/tiles_default_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698