[go: nahoru, domu]

Reland "Cancel the ChromeVox hint if the system tray bubble is shown"

This is a reland of https://www.crrev.com/c/2757174

The initial change was reverted to enable a clean revert of the
upstream change: https://www.crrev.com/c/2752922

Original change's description:
> In order to cancel the ChromeVox hint when the system tray bubble is
> shown, this change does the following:
> 1. Renames SystemTrayFocusObserver to SystemTrayObserver for better
> naming.
> 2. Adds a method called OnSystemTrayBubbleShown to SystemTrayObserver.
> 3. Implements the above method in CoreOobeHandler that cancels the
> ChromeVox hint.
>
> clicking the status area and waiting 20s.
> clicked.

> Fixed: 1186501
> Test: Manual. Verify that the ChromeVox hint does not fire after
> AX-Relnotes: Cancel the ChromeVox hint timer if the status area is
> Change-Id: Ib18b07c9fd7411b96276488ae32012bfcbf62358
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2757174
> Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#866363}

Change-Id: I461a9e516322e25069425a3d3daf2fb6790d0734
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795505
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#870110}
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index 32bfd480..54a76ad4 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -66,11 +66,11 @@
 LoginScreenController::LoginScreenController(
     SystemTrayNotifier* system_tray_notifier)
     : system_tray_notifier_(system_tray_notifier) {
-  system_tray_notifier_->AddSystemTrayFocusObserver(this);
+  system_tray_notifier_->AddSystemTrayObserver(this);
 }
 
 LoginScreenController::~LoginScreenController() {
-  system_tray_notifier_->RemoveSystemTrayFocusObserver(this);
+  system_tray_notifier_->RemoveSystemTrayObserver(this);
 }
 
 // static
@@ -481,6 +481,12 @@
   client_->OnFocusLeavingSystemTray(reverse);
 }
 
+void LoginScreenController::OnSystemTrayBubbleShown() {
+  if (!client_)
+    return;
+  client_->OnSystemTrayBubbleShown();
+}
+
 void LoginScreenController::OnLockScreenDestroyed() {
   DCHECK_EQ(authentication_stage_, AuthenticationStage::kIdle);