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

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

Issue 2768703002: Wire up an api to darken screen for accessibility (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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "chrome/browser/profiles/profile.h" 51 #include "chrome/browser/profiles/profile.h"
52 #include "chrome/browser/profiles/profile_manager.h" 52 #include "chrome/browser/profiles/profile_manager.h"
53 #include "chrome/browser/ui/ash/ash_util.h" 53 #include "chrome/browser/ui/ash/ash_util.h"
54 #include "chrome/common/chrome_paths.h" 54 #include "chrome/common/chrome_paths.h"
55 #include "chrome/common/extensions/api/accessibility_private.h" 55 #include "chrome/common/extensions/api/accessibility_private.h"
56 #include "chrome/common/extensions/extension_constants.h" 56 #include "chrome/common/extensions/extension_constants.h"
57 #include "chrome/common/pref_names.h" 57 #include "chrome/common/pref_names.h"
58 #include "chrome/grit/browser_resources.h" 58 #include "chrome/grit/browser_resources.h"
59 #include "chromeos/audio/audio_a11y_controller.h" 59 #include "chromeos/audio/audio_a11y_controller.h"
60 #include "chromeos/audio/chromeos_sounds.h" 60 #include "chromeos/audio/chromeos_sounds.h"
61 #include "chromeos/dbus/dbus_thread_manager.h"
62 #include "chromeos/dbus/power_manager_client.h"
61 #include "components/prefs/pref_member.h" 63 #include "components/prefs/pref_member.h"
62 #include "components/prefs/pref_service.h" 64 #include "components/prefs/pref_service.h"
63 #include "components/session_manager/core/session_manager.h" 65 #include "components/session_manager/core/session_manager.h"
64 #include "content/public/browser/browser_accessibility_state.h" 66 #include "content/public/browser/browser_accessibility_state.h"
65 #include "content/public/browser/browser_thread.h" 67 #include "content/public/browser/browser_thread.h"
66 #include "content/public/browser/notification_details.h" 68 #include "content/public/browser/notification_details.h"
67 #include "content/public/browser/notification_service.h" 69 #include "content/public/browser/notification_service.h"
68 #include "content/public/browser/notification_source.h" 70 #include "content/public/browser/notification_source.h"
69 #include "content/public/browser/web_ui.h" 71 #include "content/public/browser/web_ui.h"
70 #include "content/public/common/content_switches.h" 72 #include "content/public/common/content_switches.h"
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 PlayEarcon(SOUND_SPOKEN_FEEDBACK_DISABLED, PlaySoundOption::ALWAYS); 1375 PlayEarcon(SOUND_SPOKEN_FEEDBACK_DISABLED, PlaySoundOption::ALWAYS);
1374 // Clear the accessibility focus ring. 1376 // Clear the accessibility focus ring.
1375 AccessibilityFocusRingController::GetInstance()->SetFocusRing( 1377 AccessibilityFocusRingController::GetInstance()->SetFocusRing(
1376 std::vector<gfx::Rect>(), 1378 std::vector<gfx::Rect>(),
1377 AccessibilityFocusRingController::PERSIST_FOCUS_RING); 1379 AccessibilityFocusRingController::PERSIST_FOCUS_RING);
1378 1380
1379 if (chromevox_panel_) { 1381 if (chromevox_panel_) {
1380 chromevox_panel_->Close(); 1382 chromevox_panel_->Close();
1381 chromevox_panel_ = nullptr; 1383 chromevox_panel_ = nullptr;
1382 } 1384 }
1385
1386 // In case the user darkened the screen, undarken it now.
1387 chromeos::DBusThreadManager::Get()
1388 ->GetPowerManagerClient()
1389 ->SetBacklightsForcedOff(false);
1383 } 1390 }
1384 1391
1385 void AccessibilityManager::PostSwitchChromeVoxProfile() { 1392 void AccessibilityManager::PostSwitchChromeVoxProfile() {
1386 ReloadChromeVoxPanel(); 1393 ReloadChromeVoxPanel();
1387 } 1394 }
1388 1395
1389 void AccessibilityManager::ReloadChromeVoxPanel() { 1396 void AccessibilityManager::ReloadChromeVoxPanel() {
1390 if (chromevox_panel_) { 1397 if (chromevox_panel_) {
1391 chromevox_panel_->Close(); 1398 chromevox_panel_->Close();
1392 chromevox_panel_ = nullptr; 1399 chromevox_panel_ = nullptr;
(...skipping 29 matching lines...) Expand all
1422 content::BrowserContext* context) { 1429 content::BrowserContext* context) {
1423 keyboard_listener_extension_id_ = id; 1430 keyboard_listener_extension_id_ = id;
1424 1431
1425 extensions::ExtensionRegistry* registry = 1432 extensions::ExtensionRegistry* registry =
1426 extensions::ExtensionRegistry::Get(context); 1433 extensions::ExtensionRegistry::Get(context);
1427 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1434 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1428 extension_registry_observer_.Add(registry); 1435 extension_registry_observer_.Add(registry);
1429 } 1436 }
1430 1437
1431 } // namespace chromeos 1438 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/accessibility/accessibility_extension_api.cc ('k') | chrome/browser/resources/chromeos/chromevox/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698