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

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

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . 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 | « ash/mus/window_manager.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('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 (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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 profile_->GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled); 639 profile_->GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled);
640 640
641 if (autoclick_enabled_ == enabled) 641 if (autoclick_enabled_ == enabled)
642 return; 642 return;
643 autoclick_enabled_ = enabled; 643 autoclick_enabled_ = enabled;
644 644
645 if (chrome::IsRunningInMash()) { 645 if (chrome::IsRunningInMash()) {
646 service_manager::Connector* connector = 646 service_manager::Connector* connector =
647 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 647 content::ServiceManagerConnection::GetForProcess()->GetConnector();
648 mash::mojom::LaunchablePtr launchable; 648 mash::mojom::LaunchablePtr launchable;
649 connector->ConnectToInterface("accessibility_autoclick", &launchable); 649 connector->BindInterface("accessibility_autoclick", &launchable);
650 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT); 650 launchable->Launch(mash::mojom::kWindow, mash::mojom::LaunchMode::DEFAULT);
651 return; 651 return;
652 } 652 }
653 653
654 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled); 654 ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled);
655 } 655 }
656 656
657 void AccessibilityManager::SetAutoclickDelay(int delay_ms) { 657 void AccessibilityManager::SetAutoclickDelay(int delay_ms) {
658 if (!profile_) 658 if (!profile_)
659 return; 659 return;
(...skipping 16 matching lines...) Expand all
676 prefs::kAccessibilityAutoclickDelayMs)}); 676 prefs::kAccessibilityAutoclickDelayMs)});
677 677
678 if (autoclick_delay_ms == autoclick_delay_ms_) 678 if (autoclick_delay_ms == autoclick_delay_ms_)
679 return; 679 return;
680 autoclick_delay_ms_ = autoclick_delay_ms; 680 autoclick_delay_ms_ = autoclick_delay_ms;
681 681
682 if (chrome::IsRunningInMash()) { 682 if (chrome::IsRunningInMash()) {
683 service_manager::Connector* connector = 683 service_manager::Connector* connector =
684 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 684 content::ServiceManagerConnection::GetForProcess()->GetConnector();
685 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller; 685 ash::autoclick::mojom::AutoclickControllerPtr autoclick_controller;
686 connector->ConnectToInterface("accessibility_autoclick", 686 connector->BindInterface("accessibility_autoclick", &autoclick_controller);
687 &autoclick_controller);
688 autoclick_controller->SetAutoclickDelay( 687 autoclick_controller->SetAutoclickDelay(
689 autoclick_delay_ms_.InMilliseconds()); 688 autoclick_delay_ms_.InMilliseconds());
690 return; 689 return;
691 } 690 }
692 691
693 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( 692 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay(
694 autoclick_delay_ms_); 693 autoclick_delay_ms_);
695 } 694 }
696 695
697 void AccessibilityManager::EnableVirtualKeyboard(bool enabled) { 696 void AccessibilityManager::EnableVirtualKeyboard(bool enabled) {
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 content::BrowserContext* context) { 1401 content::BrowserContext* context) {
1403 keyboard_listener_extension_id_ = id; 1402 keyboard_listener_extension_id_ = id;
1404 1403
1405 extensions::ExtensionRegistry* registry = 1404 extensions::ExtensionRegistry* registry =
1406 extensions::ExtensionRegistry::Get(context); 1405 extensions::ExtensionRegistry::Get(context);
1407 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1406 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1408 extension_registry_observer_.Add(registry); 1407 extension_registry_observer_.Add(registry);
1409 } 1408 }
1410 1409
1411 } // namespace chromeos 1410 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/mus/window_manager.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698