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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 2540333004: Merge to M56: Revert "Toggle spoken feedback if two fingers are held down." (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/accessibility/accessibility_manager.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 bundle.GetRawDataResource(IDR_SOUND_SPOKEN_FEEDBACK_ENABLED_WAV)); 288 bundle.GetRawDataResource(IDR_SOUND_SPOKEN_FEEDBACK_ENABLED_WAV));
289 manager->Initialize( 289 manager->Initialize(
290 SOUND_SPOKEN_FEEDBACK_DISABLED, 290 SOUND_SPOKEN_FEEDBACK_DISABLED,
291 bundle.GetRawDataResource(IDR_SOUND_SPOKEN_FEEDBACK_DISABLED_WAV)); 291 bundle.GetRawDataResource(IDR_SOUND_SPOKEN_FEEDBACK_DISABLED_WAV));
292 manager->Initialize(SOUND_PASSTHROUGH, 292 manager->Initialize(SOUND_PASSTHROUGH,
293 bundle.GetRawDataResource(IDR_SOUND_PASSTHROUGH_WAV)); 293 bundle.GetRawDataResource(IDR_SOUND_PASSTHROUGH_WAV));
294 manager->Initialize(SOUND_EXIT_SCREEN, 294 manager->Initialize(SOUND_EXIT_SCREEN,
295 bundle.GetRawDataResource(IDR_SOUND_EXIT_SCREEN_WAV)); 295 bundle.GetRawDataResource(IDR_SOUND_EXIT_SCREEN_WAV));
296 manager->Initialize(SOUND_ENTER_SCREEN, 296 manager->Initialize(SOUND_ENTER_SCREEN,
297 bundle.GetRawDataResource(IDR_SOUND_ENTER_SCREEN_WAV)); 297 bundle.GetRawDataResource(IDR_SOUND_ENTER_SCREEN_WAV));
298 manager->Initialize(SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH,
299 bundle.GetRawDataResource(
300 IDR_SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH_WAV));
301 manager->Initialize(SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW,
302 bundle.GetRawDataResource(
303 IDR_SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW_WAV));
304 298
305 base::FilePath resources_path; 299 base::FilePath resources_path;
306 if (!PathService::Get(chrome::DIR_RESOURCES, &resources_path)) 300 if (!PathService::Get(chrome::DIR_RESOURCES, &resources_path))
307 NOTREACHED(); 301 NOTREACHED();
308 chromevox_loader_ = base::WrapUnique(new AccessibilityExtensionLoader( 302 chromevox_loader_ = base::WrapUnique(new AccessibilityExtensionLoader(
309 extension_misc::kChromeVoxExtensionId, 303 extension_misc::kChromeVoxExtensionId,
310 resources_path.Append(extension_misc::kChromeVoxExtensionPath), 304 resources_path.Append(extension_misc::kChromeVoxExtensionPath),
311 base::Bind(&AccessibilityManager::PostUnloadChromeVox, 305 base::Bind(&AccessibilityManager::PostUnloadChromeVox,
312 weak_ptr_factory_.GetWeakPtr()))); 306 weak_ptr_factory_.GetWeakPtr())));
313 select_to_speak_loader_ = base::WrapUnique(new AccessibilityExtensionLoader( 307 select_to_speak_loader_ = base::WrapUnique(new AccessibilityExtensionLoader(
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); 544 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
551 if (cl->HasSwitch(kAshDisableSystemSounds)) 545 if (cl->HasSwitch(kAshDisableSystemSounds))
552 return false; 546 return false;
553 if (option == PlaySoundOption::SPOKEN_FEEDBACK_ENABLED && 547 if (option == PlaySoundOption::SPOKEN_FEEDBACK_ENABLED &&
554 !IsSpokenFeedbackEnabled() && !cl->HasSwitch(kAshEnableSystemSounds)) { 548 !IsSpokenFeedbackEnabled() && !cl->HasSwitch(kAshEnableSystemSounds)) {
555 return false; 549 return false;
556 } 550 }
557 return media::SoundsManager::Get()->Play(sound_key); 551 return media::SoundsManager::Get()->Play(sound_key);
558 } 552 }
559 553
560 bool AccessibilityManager::PlaySpokenFeedbackToggleCountdown(int tick_count) {
561 return media::SoundsManager::Get()->Play(
562 tick_count % 2 ? SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_HIGH
563 : SOUND_SPOKEN_FEEDBACK_TOGGLE_COUNTDOWN_LOW);
564 }
565
566 void AccessibilityManager::HandleAccessibilityGesture(ui::AXGesture gesture) { 554 void AccessibilityManager::HandleAccessibilityGesture(ui::AXGesture gesture) {
567 extensions::EventRouter* event_router = 555 extensions::EventRouter* event_router =
568 extensions::EventRouter::Get(profile()); 556 extensions::EventRouter::Get(profile());
569 CHECK(event_router); 557 CHECK(event_router);
570 558
571 std::unique_ptr<base::ListValue> event_args(new base::ListValue()); 559 std::unique_ptr<base::ListValue> event_args(new base::ListValue());
572 event_args->AppendString(ui::ToString(gesture)); 560 event_args->AppendString(ui::ToString(gesture));
573 std::unique_ptr<extensions::Event> event(new extensions::Event( 561 std::unique_ptr<extensions::Event> event(new extensions::Event(
574 extensions::events::ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE, 562 extensions::events::ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE,
575 extensions::api::accessibility_private::OnAccessibilityGesture:: 563 extensions::api::accessibility_private::OnAccessibilityGesture::
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 content::BrowserContext* context) { 1357 content::BrowserContext* context) {
1370 keyboard_listener_extension_id_ = id; 1358 keyboard_listener_extension_id_ = id;
1371 1359
1372 extensions::ExtensionRegistry* registry = 1360 extensions::ExtensionRegistry* registry =
1373 extensions::ExtensionRegistry::Get(context); 1361 extensions::ExtensionRegistry::Get(context);
1374 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1362 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1375 extension_registry_observer_.Add(registry); 1363 extension_registry_observer_.Add(registry);
1376 } 1364 }
1377 1365
1378 } // namespace chromeos 1366 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698