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

Side by Side 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 3 years, 11 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h" 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 detail.event_type = ui::AX_EVENT_MEDIA_STOPPED_PLAYING; 241 detail.event_type = ui::AX_EVENT_MEDIA_STOPPED_PLAYING;
242 details.push_back(detail); 242 details.push_back(detail);
243 AccessibilityEventReceived(details); 243 AccessibilityEventReceived(details);
244 } 244 }
245 245
246 private: 246 private:
247 friend class content::WebContentsUserData<AutomationWebContentsObserver>; 247 friend class content::WebContentsUserData<AutomationWebContentsObserver>;
248 248
249 explicit AutomationWebContentsObserver(content::WebContents* web_contents) 249 explicit AutomationWebContentsObserver(content::WebContents* web_contents)
250 : content::WebContentsObserver(web_contents), 250 : content::WebContentsObserver(web_contents),
251 browser_context_(web_contents->GetBrowserContext()) {} 251 browser_context_(web_contents->GetBrowserContext()) {
252 if (web_contents->WasRecentlyAudible()) {
253 std::vector<content::AXEventNotificationDetails> details;
254 content::RenderFrameHost* rfh = web_contents->GetMainFrame();
255 if (!rfh)
256 return;
257
258 content::AXEventNotificationDetails detail;
259 detail.ax_tree_id = rfh->GetAXTreeID();
260 detail.event_type = ui::AX_EVENT_MEDIA_STARTED_PLAYING;
261 details.push_back(detail);
262 AccessibilityEventReceived(details);
263 }
264 }
252 265
253 content::BrowserContext* browser_context_; 266 content::BrowserContext* browser_context_;
254 267
255 DISALLOW_COPY_AND_ASSIGN(AutomationWebContentsObserver); 268 DISALLOW_COPY_AND_ASSIGN(AutomationWebContentsObserver);
256 }; 269 };
257 270
258 ExtensionFunction::ResponseAction 271 ExtensionFunction::ResponseAction
259 AutomationInternalEnableTabFunction::Run() { 272 AutomationInternalEnableTabFunction::Run() {
260 const AutomationInfo* automation_info = AutomationInfo::Get(extension()); 273 const AutomationInfo* automation_info = AutomationInfo::Get(extension());
261 EXTENSION_FUNCTION_VALIDATE(automation_info); 274 EXTENSION_FUNCTION_VALIDATE(automation_info);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 if (!error.empty()) { 534 if (!error.empty()) {
522 Respond(Error(error)); 535 Respond(Error(error));
523 return; 536 return;
524 } 537 }
525 538
526 Respond( 539 Respond(
527 OneArgument(base::MakeUnique<base::FundamentalValue>(result_acc_obj_id))); 540 OneArgument(base::MakeUnique<base::FundamentalValue>(result_acc_obj_id)));
528 } 541 }
529 542
530 } // namespace extensions 543 } // namespace extensions
OLDNEW
« 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