OLD | NEW |
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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 profile_->GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled); | 596 profile_->GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled); |
597 | 597 |
598 if (autoclick_enabled_ == enabled) | 598 if (autoclick_enabled_ == enabled) |
599 return; | 599 return; |
600 autoclick_enabled_ = enabled; | 600 autoclick_enabled_ = enabled; |
601 | 601 |
602 if (chrome::IsRunningInMash()) { | 602 if (chrome::IsRunningInMash()) { |
603 shell::Connector* connector = | 603 shell::Connector* connector = |
604 content::MojoShellConnection::GetForProcess()->GetConnector(); | 604 content::MojoShellConnection::GetForProcess()->GetConnector(); |
605 mash::mojom::LaunchablePtr launchable; | 605 mash::mojom::LaunchablePtr launchable; |
606 connector->ConnectToInterface("mojo:accessibility_autoclick", &launchable); | 606 connector->ConnectToInterface("service:accessibility_autoclick", |
| 607 &launchable); |
607 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT); | 608 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT); |
608 return; | 609 return; |
609 } | 610 } |
610 | 611 |
611 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled); | 612 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled); |
612 } | 613 } |
613 | 614 |
614 void AccessibilityManager::SetAutoclickDelay(int delay_ms) { | 615 void AccessibilityManager::SetAutoclickDelay(int delay_ms) { |
615 if (!profile_) | 616 if (!profile_) |
616 return; | 617 return; |
(...skipping 16 matching lines...) Expand all Loading... |
633 prefs::kAccessibilityAutoclickDelayMs)}); | 634 prefs::kAccessibilityAutoclickDelayMs)}); |
634 | 635 |
635 if (autoclick_delay_ms == autoclick_delay_ms_) | 636 if (autoclick_delay_ms == autoclick_delay_ms_) |
636 return; | 637 return; |
637 autoclick_delay_ms_ = autoclick_delay_ms; | 638 autoclick_delay_ms_ = autoclick_delay_ms; |
638 | 639 |
639 if (chrome::IsRunningInMash()) { | 640 if (chrome::IsRunningInMash()) { |
640 shell::Connector* connector = | 641 shell::Connector* connector = |
641 content::MojoShellConnection::GetForProcess()->GetConnector(); | 642 content::MojoShellConnection::GetForProcess()->GetConnector(); |
642 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller; | 643 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller; |
643 connector->ConnectToInterface("mojo:accessibility_autoclick", | 644 connector->ConnectToInterface("service:accessibility_autoclick", |
644 &autoclick_controller); | 645 &autoclick_controller); |
645 autoclick_controller->SetAutoclickDelay( | 646 autoclick_controller->SetAutoclickDelay( |
646 autoclick_delay_ms_.InMilliseconds()); | 647 autoclick_delay_ms_.InMilliseconds()); |
647 return; | 648 return; |
648 } | 649 } |
649 | 650 |
650 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( | 651 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( |
651 autoclick_delay_ms_); | 652 autoclick_delay_ms_); |
652 } | 653 } |
653 | 654 |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 content::BrowserContext* context) { | 1343 content::BrowserContext* context) { |
1343 keyboard_listener_extension_id_ = id; | 1344 keyboard_listener_extension_id_ = id; |
1344 | 1345 |
1345 extensions::ExtensionRegistry* registry = | 1346 extensions::ExtensionRegistry* registry = |
1346 extensions::ExtensionRegistry::Get(context); | 1347 extensions::ExtensionRegistry::Get(context); |
1347 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1348 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
1348 extension_registry_observer_.Add(registry); | 1349 extension_registry_observer_.Add(registry); |
1349 } | 1350 } |
1350 | 1351 |
1351 } // namespace chromeos | 1352 } // namespace chromeos |
OLD | NEW |