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

Unified Diff: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc

Issue 2563013003: Support audio ducking and suspension in ChromeVox (Closed)
Patch Set: Fix compile. Created 4 years 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 | « no previous file | chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
index f2238acc30cd01d89f32a677953c7db77b41ce14..ccaf89d8936725234b2d3695b942006abb3b56dd 100644
--- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
+++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
@@ -248,7 +248,20 @@ class AutomationWebContentsObserver
explicit AutomationWebContentsObserver(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
- browser_context_(web_contents->GetBrowserContext()) {}
+ browser_context_(web_contents->GetBrowserContext()) {
+ if (web_contents->WasRecentlyAudible()) {
+ std::vector<content::AXEventNotificationDetails> details;
+ content::RenderFrameHost* rfh = web_contents->GetMainFrame();
+ if (!rfh)
+ return;
+
+ content::AXEventNotificationDetails detail;
+ detail.ax_tree_id = rfh->GetAXTreeID();
+ detail.event_type = ui::AX_EVENT_MEDIA_STARTED_PLAYING;
+ details.push_back(detail);
+ AccessibilityEventReceived(details);
+ }
+ }
content::BrowserContext* browser_context_;
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/chromevox/background/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698