summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspang <spang@chromium.org>2014-12-10 17:20:10 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-11 01:20:55 +0000
commite9b512747b0e89234415f3fb6a16aab6ecd3c482 (patch)
treeceebccc6f5d0783a9323a14c9fc7e4deb34755fd
parent6f8daecc4e11f9dc8bd2244131a511abd798b456 (diff)
downloadchromium_src-e9b512747b0e89234415f3fb6a16aab6ecd3c482.zip
chromium_src-e9b512747b0e89234415f3fb6a16aab6ecd3c482.tar.gz
chromium_src-e9b512747b0e89234415f3fb6a16aab6ecd3c482.tar.bz2
ash: ozone: Enable MagnifierKeyScroller & SpokenFeedbackToggler
These can now be built after r293520 ("Removing uses of X11 native key events") but were not enabled in the build. Enable them. BUG=401316 TEST=ash_unittests Review URL: https://codereview.chromium.org/789013002 Cr-Commit-Position: refs/heads/master@{#307822}
-rw-r--r--ash/BUILD.gn20
-rw-r--r--ash/ash.gyp26
-rw-r--r--ash/shell.cc12
-rw-r--r--ash/shell.h2
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc2
5 files changed, 24 insertions, 38 deletions
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index 3bfb97d..7642e9a 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -67,12 +67,6 @@ component("ash") {
configs += [ "//build/config/linux:xfixes" ]
} else {
sources -= [
- "accelerators/key_hold_detector.cc",
- "accelerators/key_hold_detector.h",
- "accelerators/magnifier_key_scroller.cc",
- "accelerators/magnifier_key_scroller.h",
- "accelerators/spoken_feedback_toggler.cc",
- "accelerators/spoken_feedback_toggler.h",
"host/ash_window_tree_host_x11.cc",
"host/ash_window_tree_host_x11.h",
"wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc",
@@ -93,6 +87,12 @@ component("ash") {
]
} else {
sources -= [
+ "accelerators/key_hold_detector.cc",
+ "accelerators/key_hold_detector.h",
+ "accelerators/magnifier_key_scroller.cc",
+ "accelerators/magnifier_key_scroller.h",
+ "accelerators/spoken_feedback_toggler.cc",
+ "accelerators/spoken_feedback_toggler.h",
"display/display_configurator_animation.cc",
"display/display_configurator_animation.h",
"display/resolution_notification_controller.cc",
@@ -297,11 +297,7 @@ test("ash_unittests") {
}
if (!use_x11) {
- sources -= [
- "accelerators/magnifier_key_scroller_unittest.cc",
- "accelerators/spoken_feedback_toggler_unittest.cc",
- "host/ash_window_tree_host_x11_unittest.cc",
- ]
+ sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ]
}
if (is_chromeos) {
sources += [ "first_run/first_run_helper_unittest.cc" ]
@@ -315,6 +311,8 @@ test("ash_unittests") {
]
} else {
sources -= [
+ "accelerators/magnifier_key_scroller_unittest.cc",
+ "accelerators/spoken_feedback_toggler_unittest.cc",
"display/resolution_notification_controller_unittest.cc",
"touch/touchscreen_util_unittest.cc",
]
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 473dd14..ca3191b 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -934,17 +934,7 @@
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
}],
- ['use_x11!=1', {
- 'sources!': [
- # Note: sources list duplicated in GN build.
- 'accelerators/key_hold_detector.cc',
- 'accelerators/key_hold_detector.h',
- 'accelerators/magnifier_key_scroller.cc',
- 'accelerators/magnifier_key_scroller.h',
- 'accelerators/spoken_feedback_toggler.cc',
- 'accelerators/spoken_feedback_toggler.h',
- ],
- }, { # else: use_x11==1
+ ['use_x11==1', {
'dependencies': [
'../build/linux/system.gyp:xfixes',
],
@@ -963,6 +953,12 @@
],
}, { # else: chromeos!=1
'sources!': [
+ 'accelerators/key_hold_detector.cc',
+ 'accelerators/key_hold_detector.h',
+ 'accelerators/magnifier_key_scroller.cc',
+ 'accelerators/magnifier_key_scroller.h',
+ 'accelerators/spoken_feedback_toggler.cc',
+ 'accelerators/spoken_feedback_toggler.h',
'display/display_configurator_animation.cc',
'display/display_configurator_animation.h',
'display/resolution_notification_controller.cc',
@@ -1133,12 +1129,6 @@
'../base/allocator/allocator.gyp:allocator',
],
}],
- ['use_x11!=1', {
- 'sources!': [
- 'accelerators/magnifier_key_scroller_unittest.cc',
- 'accelerators/spoken_feedback_toggler_unittest.cc',
- ],
- }],
['chromeos==1', {
'dependencies': [
'../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
@@ -1153,6 +1143,8 @@
],
}, { # else: chromeos!=1
'sources!': [
+ 'accelerators/magnifier_key_scroller_unittest.cc',
+ 'accelerators/spoken_feedback_toggler_unittest.cc',
'display/resolution_notification_controller_unittest.cc',
'touch/touch_transformer_controller_unittest.cc',
'touch/touchscreen_util_unittest.cc',
diff --git a/ash/shell.cc b/ash/shell.cc
index 21b62f2..3e3135a 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -116,10 +116,10 @@
#if defined(OS_CHROMEOS)
#if defined(USE_X11)
-#include "ash/accelerators/magnifier_key_scroller.h"
-#include "ash/accelerators/spoken_feedback_toggler.h"
#include "ui/gfx/x/x11_types.h"
#endif // defined(USE_X11)
+#include "ash/accelerators/magnifier_key_scroller.h"
+#include "ash/accelerators/spoken_feedback_toggler.h"
#include "ash/ash_constants.h"
#include "ash/content/display/screen_orientation_delegate_chromeos.h"
#include "ash/display/display_change_observer_chromeos.h"
@@ -673,7 +673,7 @@ Shell::~Shell() {
// Please keep in same order as in Init() because it's easy to miss one.
if (window_modality_controller_)
window_modality_controller_.reset();
-#if defined(OS_CHROMEOS) && defined(USE_X11)
+#if defined(OS_CHROMEOS)
RemovePreTargetHandler(magnifier_key_scroll_handler_.get());
magnifier_key_scroll_handler_.reset();
@@ -902,10 +902,10 @@ void Shell::Init(const ShellInitParams& init_params) {
accelerator_controller_.reset(new AcceleratorController);
maximize_mode_controller_.reset(new MaximizeModeController());
-#if defined(OS_CHROMEOS) && defined(USE_X11)
- magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler().Pass();
+#if defined(OS_CHROMEOS)
+ magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler();
AddPreTargetHandler(magnifier_key_scroll_handler_.get());
- speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler().Pass();
+ speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler();
AddPreTargetHandler(speech_feedback_handler_.get());
#endif
diff --git a/ash/shell.h b/ash/shell.h
index 0286097..d6b2913 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -738,10 +738,8 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
scoped_ptr<TouchTransformerController> touch_transformer_controller_;
-#if defined(USE_X11)
scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
scoped_ptr<ui::EventHandler> speech_feedback_handler_;
-#endif // defined(USE_X11)
#endif // defined(OS_CHROMEOS)
scoped_ptr<MaximizeModeController> maximize_mode_controller_;
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
index 6d44e95..80b714b 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
@@ -56,14 +56,12 @@ void InitAfterSessionStart() {
if (!mru_list.empty())
mru_list.front()->Focus();
-#if defined(USE_X11)
// Enable magnifier scroll keys as there may be no mouse cursor in kiosk mode.
ash::MagnifierKeyScroller::SetEnabled(chrome::IsRunningInForcedAppMode());
// Enable long press action to toggle spoken feedback with hotrod
// remote which can't handle shortcut.
ash::SpokenFeedbackToggler::SetEnabled(chrome::IsRunningInForcedAppMode());
-#endif
}
#if !defined(USE_ATHENA)