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

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

Issue 2808053004: Fire accessibilityPrivate events on two-finger hold gesture. (Closed)
Patch Set: Rebase Created 3 years, 8 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
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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); 590 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
591 if (cl->HasSwitch(kAshDisableSystemSounds)) 591 if (cl->HasSwitch(kAshDisableSystemSounds))
592 return false; 592 return false;
593 if (option == PlaySoundOption::SPOKEN_FEEDBACK_ENABLED && 593 if (option == PlaySoundOption::SPOKEN_FEEDBACK_ENABLED &&
594 !IsSpokenFeedbackEnabled() && !cl->HasSwitch(kAshEnableSystemSounds)) { 594 !IsSpokenFeedbackEnabled() && !cl->HasSwitch(kAshEnableSystemSounds)) {
595 return false; 595 return false;
596 } 596 }
597 return media::SoundsManager::Get()->Play(sound_key); 597 return media::SoundsManager::Get()->Play(sound_key);
598 } 598 }
599 599
600 void AccessibilityManager::OnTwoFingerTouchStart() {
601 extensions::EventRouter* event_router =
602 extensions::EventRouter::Get(profile());
603 CHECK(event_router);
604
605 std::unique_ptr<base::ListValue> event_args(new base::ListValue());
oshima 2017/04/10 18:32:08 nit: MakeUnique same for the rest.
dmazzoni 2017/04/11 05:49:40 Done.
606 std::unique_ptr<extensions::Event> event(new extensions::Event(
607 extensions::events::ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_START,
608 extensions::api::accessibility_private::OnTwoFingerTouchStart::kEventName,
609 std::move(event_args)));
610 event_router->BroadcastEvent(std::move(event));
611 }
612
613 void AccessibilityManager::OnTwoFingerTouchStop() {
614 extensions::EventRouter* event_router =
615 extensions::EventRouter::Get(profile());
616 CHECK(event_router);
617
618 std::unique_ptr<base::ListValue> event_args(new base::ListValue());
619 std::unique_ptr<extensions::Event> event(new extensions::Event(
620 extensions::events::ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_STOP,
621 extensions::api::accessibility_private::OnTwoFingerTouchStop::kEventName,
622 std::move(event_args)));
623 event_router->BroadcastEvent(std::move(event));
624 }
625
600 bool AccessibilityManager::ShouldToggleSpokenFeedbackViaTouch() { 626 bool AccessibilityManager::ShouldToggleSpokenFeedbackViaTouch() {
601 #if 1 627 #if 1
602 // Temporarily disabling this feature until UI feedback is fixed. 628 // Temporarily disabling this feature until UI feedback is fixed.
603 // http://crbug.com/662501 629 // http://crbug.com/662501
604 return false; 630 return false;
605 #else 631 #else
606 policy::BrowserPolicyConnectorChromeOS* connector = 632 policy::BrowserPolicyConnectorChromeOS* connector =
607 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 633 g_browser_process->platform_part()->browser_policy_connector_chromeos();
608 if (!connector) 634 if (!connector)
609 return false; 635 return false;
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 content::BrowserContext* context) { 1522 content::BrowserContext* context) {
1497 keyboard_listener_extension_id_ = id; 1523 keyboard_listener_extension_id_ = id;
1498 1524
1499 extensions::ExtensionRegistry* registry = 1525 extensions::ExtensionRegistry* registry =
1500 extensions::ExtensionRegistry::Get(context); 1526 extensions::ExtensionRegistry::Get(context);
1501 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1527 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1502 extension_registry_observer_.Add(registry); 1528 extension_registry_observer_.Add(registry);
1503 } 1529 }
1504 1530
1505 } // namespace chromeos 1531 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698