| 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 return; | 593 return; |
| 594 | 594 |
| 595 bool enabled = | 595 bool enabled = |
| 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 service_manager::Connector* connector = |
| 604 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 604 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 605 mash::mojom::LaunchablePtr launchable; | 605 mash::mojom::LaunchablePtr launchable; |
| 606 connector->ConnectToInterface("service:accessibility_autoclick", | 606 connector->ConnectToInterface("service:accessibility_autoclick", |
| 607 &launchable); | 607 &launchable); |
| 608 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT); | 608 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT); |
| 609 return; | 609 return; |
| 610 } | 610 } |
| 611 | 611 |
| 612 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled); | 612 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled); |
| 613 } | 613 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 631 | 631 |
| 632 base::TimeDelta autoclick_delay_ms = base::TimeDelta::FromMilliseconds( | 632 base::TimeDelta autoclick_delay_ms = base::TimeDelta::FromMilliseconds( |
| 633 int64_t{profile_->GetPrefs()->GetInteger( | 633 int64_t{profile_->GetPrefs()->GetInteger( |
| 634 prefs::kAccessibilityAutoclickDelayMs)}); | 634 prefs::kAccessibilityAutoclickDelayMs)}); |
| 635 | 635 |
| 636 if (autoclick_delay_ms == autoclick_delay_ms_) | 636 if (autoclick_delay_ms == autoclick_delay_ms_) |
| 637 return; | 637 return; |
| 638 autoclick_delay_ms_ = autoclick_delay_ms; | 638 autoclick_delay_ms_ = autoclick_delay_ms; |
| 639 | 639 |
| 640 if (chrome::IsRunningInMash()) { | 640 if (chrome::IsRunningInMash()) { |
| 641 shell::Connector* connector = | 641 service_manager::Connector* connector = |
| 642 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 642 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 643 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller; | 643 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller; |
| 644 connector->ConnectToInterface("service:accessibility_autoclick", | 644 connector->ConnectToInterface("service:accessibility_autoclick", |
| 645 &autoclick_controller); | 645 &autoclick_controller); |
| 646 autoclick_controller->SetAutoclickDelay( | 646 autoclick_controller->SetAutoclickDelay( |
| 647 autoclick_delay_ms_.InMilliseconds()); | 647 autoclick_delay_ms_.InMilliseconds()); |
| 648 return; | 648 return; |
| 649 } | 649 } |
| 650 | 650 |
| 651 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( | 651 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 content::BrowserContext* context) { | 1343 content::BrowserContext* context) { |
| 1344 keyboard_listener_extension_id_ = id; | 1344 keyboard_listener_extension_id_ = id; |
| 1345 | 1345 |
| 1346 extensions::ExtensionRegistry* registry = | 1346 extensions::ExtensionRegistry* registry = |
| 1347 extensions::ExtensionRegistry::Get(context); | 1347 extensions::ExtensionRegistry::Get(context); |
| 1348 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1348 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1349 extension_registry_observer_.Add(registry); | 1349 extension_registry_observer_.Add(registry); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 } // namespace chromeos | 1352 } // namespace chromeos |
| OLD | NEW |