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

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

Issue 2016073004: Show a visual indicator for the progress of auto-click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebase. Created 4 years, 6 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 cursor_highlight_pref_handler_( 408 cursor_highlight_pref_handler_(
409 prefs::kAccessibilityCursorHighlightEnabled), 409 prefs::kAccessibilityCursorHighlightEnabled),
410 focus_highlight_pref_handler_(prefs::kAccessibilityFocusHighlightEnabled), 410 focus_highlight_pref_handler_(prefs::kAccessibilityFocusHighlightEnabled),
411 select_to_speak_pref_handler_(prefs::kAccessibilitySelectToSpeakEnabled), 411 select_to_speak_pref_handler_(prefs::kAccessibilitySelectToSpeakEnabled),
412 switch_access_pref_handler_(prefs::kAccessibilitySwitchAccessEnabled), 412 switch_access_pref_handler_(prefs::kAccessibilitySwitchAccessEnabled),
413 large_cursor_enabled_(false), 413 large_cursor_enabled_(false),
414 sticky_keys_enabled_(false), 414 sticky_keys_enabled_(false),
415 spoken_feedback_enabled_(false), 415 spoken_feedback_enabled_(false),
416 high_contrast_enabled_(false), 416 high_contrast_enabled_(false),
417 autoclick_enabled_(false), 417 autoclick_enabled_(false),
418 autoclick_delay_ms_(ash::AutoclickController::kDefaultAutoclickDelayMs), 418 autoclick_delay_ms_(ash::AutoclickController::GetDefaultAutoclickDelay()),
419 virtual_keyboard_enabled_(false), 419 virtual_keyboard_enabled_(false),
420 mono_audio_enabled_(false), 420 mono_audio_enabled_(false),
421 caret_highlight_enabled_(false), 421 caret_highlight_enabled_(false),
422 cursor_highlight_enabled_(false), 422 cursor_highlight_enabled_(false),
423 focus_highlight_enabled_(false), 423 focus_highlight_enabled_(false),
424 select_to_speak_enabled_(false), 424 select_to_speak_enabled_(false),
425 switch_access_enabled_(false), 425 switch_access_enabled_(false),
426 spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE), 426 spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE),
427 should_speak_chrome_vox_announcements_on_user_screen_(true), 427 should_speak_chrome_vox_announcements_on_user_screen_(true),
428 system_sounds_enabled_(false), 428 system_sounds_enabled_(false),
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 void AccessibilityManager::SetAutoclickDelay(int delay_ms) { 835 void AccessibilityManager::SetAutoclickDelay(int delay_ms) {
836 if (!profile_) 836 if (!profile_)
837 return; 837 return;
838 838
839 PrefService* pref_service = profile_->GetPrefs(); 839 PrefService* pref_service = profile_->GetPrefs();
840 pref_service->SetInteger(prefs::kAccessibilityAutoclickDelayMs, delay_ms); 840 pref_service->SetInteger(prefs::kAccessibilityAutoclickDelayMs, delay_ms);
841 pref_service->CommitPendingWrite(); 841 pref_service->CommitPendingWrite();
842 } 842 }
843 843
844 int AccessibilityManager::GetAutoclickDelay() const { 844 int AccessibilityManager::GetAutoclickDelay() const {
845 return autoclick_delay_ms_; 845 return int{autoclick_delay_ms_.InMilliseconds()};
846 } 846 }
847 847
848 void AccessibilityManager::UpdateAutoclickDelayFromPref() { 848 void AccessibilityManager::UpdateAutoclickDelayFromPref() {
849 if (!profile_) 849 if (!profile_)
850 return; 850 return;
851 851
852 int autoclick_delay_ms = 852 base::TimeDelta autoclick_delay_ms = base::TimeDelta::FromMilliseconds(
853 profile_->GetPrefs()->GetInteger(prefs::kAccessibilityAutoclickDelayMs); 853 int64_t{profile_->GetPrefs()->GetInteger(
854 prefs::kAccessibilityAutoclickDelayMs)});
854 855
855 if (autoclick_delay_ms == autoclick_delay_ms_) 856 if (autoclick_delay_ms == autoclick_delay_ms_)
856 return; 857 return;
857 autoclick_delay_ms_ = autoclick_delay_ms; 858 autoclick_delay_ms_ = autoclick_delay_ms;
858 859
859 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay( 860 ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay(
860 autoclick_delay_ms_); 861 autoclick_delay_ms_);
861 } 862 }
862 863
863 void AccessibilityManager::EnableVirtualKeyboard(bool enabled) { 864 void AccessibilityManager::EnableVirtualKeyboard(bool enabled) {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 content::BrowserContext* context) { 1529 content::BrowserContext* context) {
1529 keyboard_listener_extension_id_ = id; 1530 keyboard_listener_extension_id_ = id;
1530 1531
1531 extensions::ExtensionRegistry* registry = 1532 extensions::ExtensionRegistry* registry =
1532 extensions::ExtensionRegistry::Get(context); 1533 extensions::ExtensionRegistry::Get(context);
1533 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1534 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1534 extension_registry_observer_.Add(registry); 1535 extension_registry_observer_.Add(registry);
1535 } 1536 }
1536 1537
1537 } // namespace chromeos 1538 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/accessibility/accessibility_manager.h ('k') | chrome/browser/chromeos/preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698