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

Unified Diff: components/exo/shell_surface.cc

Issue 2407303003: exo: Use WMHelper to access ash accessibility related features. (Closed)
Patch Set: Fix compile errors. Created 4 years, 2 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 | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 2027afdc95cefa71592fedd06a1681c7bc6043ee..cf8cced1d4c8210fd0d2ee2a0262be8089afd467 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -7,10 +7,8 @@
#include <algorithm>
#include "ash/aura/wm_window_aura.h"
-#include "ash/common/accessibility_delegate.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shell_window_ids.h"
-#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/wm/window_resizer.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/window_state_delegate.h"
@@ -235,8 +233,7 @@ class ShadowUnderlayEventHandler : public ui::EventHandler {
std::find(std::begin(kEarconEventTypes), std::end(kEarconEventTypes),
event->type()) != std::end(kEarconEventTypes);
if (is_earcon_event_type)
- ash::WmShell::Get()->accessibility_delegate()->PlayEarcon(
- chromeos::SOUND_VOLUME_ADJUST);
+ WMHelper::GetInstance()->PlayEarcon(chromeos::SOUND_VOLUME_ADJUST);
#endif
event->SetHandled();
}
@@ -382,8 +379,7 @@ ShellSurface::~ShellSurface() {
surface_->SetSurfaceDelegate(nullptr);
surface_->RemoveSurfaceObserver(this);
}
- ash::WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(
- this);
+ WMHelper::GetInstance()->RemoveAccessibilityObserver(this);
}
void ShellSurface::AcknowledgeConfigure(uint32_t serial) {
@@ -808,14 +804,6 @@ gfx::Size ShellSurface::GetPreferredSize() const {
}
////////////////////////////////////////////////////////////////////////////////
-// ash::AccessibilityObserver overrides:
-
-void ShellSurface::OnAccessibilityModeChanged(
- ash::AccessibilityNotificationVisibility) {
- UpdateShadow();
-}
-
-////////////////////////////////////////////////////////////////////////////////
// ash::wm::WindowStateObserver overrides:
void ShellSurface::OnPreWindowStateTypeChange(
@@ -916,6 +904,13 @@ void ShellSurface::OnWindowActivated(
}
////////////////////////////////////////////////////////////////////////////////
+// WMHelper::AccessibilityObserver overrides:
+
+void ShellSurface::OnAccessibilityModeChanged() {
+ UpdateShadow();
+}
+
+////////////////////////////////////////////////////////////////////////////////
// ui::EventHandler overrides:
void ShellSurface::OnKeyEvent(ui::KeyEvent* event) {
@@ -1074,7 +1069,7 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
new CustomWindowStateDelegate(widget_)));
// Receive accessibility changes to update shadow underlay.
- ash::WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
David Tseng 2017/01/17 22:43:41 I don't understand how your cl replaces this obser
+ WMHelper::GetInstance()->AddAccessibilityObserver(this);
// Show widget next time Commit() is called.
pending_show_widget_ = true;
@@ -1350,10 +1345,9 @@ void ShellSurface::UpdateShadow() {
window->StackChildAtBottom(shadow_underlay_);
}
- bool underlay_capture_events = ash::WmShell::Get()
- ->accessibility_delegate()
- ->IsSpokenFeedbackEnabled() &&
- widget_->IsActive();
+ bool underlay_capture_events =
+ WMHelper::GetInstance()->IsSpokenFeedbackEnabled() &&
+ widget_->IsActive();
float shadow_underlay_opacity = rectangular_shadow_background_opacity_;
// Put the black background layer behind the window if
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698