diff options
author | jonross <jonross@chromium.org> | 2014-12-04 11:24:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 19:24:42 +0000 |
commit | b61d27f746c95843d107516a733f93e6d52ca26a (patch) | |
tree | fd28a3c9e6dd7d1a9914ad0de5417c0a1bba7dbd | |
parent | 38bc91e23fa7215e6f329854e50e40e5fadf7f65 (diff) | |
download | chromium_src-b61d27f746c95843d107516a733f93e6d52ca26a.zip chromium_src-b61d27f746c95843d107516a733f93e6d52ca26a.tar.gz chromium_src-b61d27f746c95843d107516a733f93e6d52ca26a.tar.bz2 |
Revert of Various changes required to support ChromeVox Next to read Views and Windows. (patchset #13 id:240001 of https://codereview.chromium.org/743273002/)
Reason for revert:
This change broken the ChromiumOS on Chromium build:
http://build.chromium.org/p/chromiumos.chromium/builders/Daisy%20%28chromium%29/builds/3342
With the error:
chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h:17:7: error: 'AXRootObjWrapper' has a field 'AXRootObjWrapper::alert_window_' whose type uses the anonymous namespace [-Werror]
Original issue's description:
> Various changes required to support ChromeVox Next to read Views and Windows.
>
> - adds support for valueChanged event (e.g. to read adjustment of the volume slider)
> - add textChanged event handler to process omnibox character echo/deletion.
> - braille support for the textChanged,textSelectionChanged events
> - whitelist ChromeVox for automation API up to stable.
> - remove the --enable-chromevox-next cmd line flag.
> - adds options for Output module (to only output braille, for example).
> - adds a "dummy" alert window as a child of the desktop root node; this window will be used to fire alert events. Due to the way we support alerts now without backing views, this is necessary.
> - start generating context for window on "enter". This picks up announcements like "status tray" when entering the status tray bar with alt+shift+s.
> - exclude the first child (only child) of the desktop node from having a name set; this is because that particular window has a non-human readable name "Display<xxx>" which gets read frequently when entering a screen/display.
>
> Committed: https://crrev.com/113aa4f1f3e207b4b134ecc7316b9c46e29a22ad
> Cr-Commit-Position: refs/heads/master@{#306855}
TBR=dmazzoni@chromium.org,plundblad@chromium.org,kalman@chromium.org,zelidrag@chromium.org,oshima@chromium.org,dtseng@chromium.org
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/779103002
Cr-Commit-Position: refs/heads/master@{#306868}
22 files changed, 100 insertions, 164 deletions
diff --git a/chrome/browser/chromeos/input_method/accessibility.cc b/chrome/browser/chromeos/input_method/accessibility.cc index eb5a7e0..031e733 100644 --- a/chrome/browser/chromeos/input_method/accessibility.cc +++ b/chrome/browser/chromeos/input_method/accessibility.cc @@ -9,7 +9,6 @@ #include "chrome/browser/accessibility/accessibility_events.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/accessibility/automation_manager_ash.h" namespace chromeos { namespace input_method { @@ -41,9 +40,6 @@ void Accessibility::InputMethodChanged(InputMethodManager* imm, medium_name); SendControlAccessibilityNotification( ui::AX_EVENT_ALERT, &event); - - AutomationManagerAsh::GetInstance()->HandleAlert( - ProfileManager::GetActiveUserProfile(), medium_name); } } // namespace input_method diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 5ae1952..93a0a67 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -43,7 +43,6 @@ #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/system/device_disabling_manager.h" #include "chrome/browser/signin/easy_unlock_service.h" -#include "chrome/browser/ui/ash/accessibility/automation_manager_ash.h" #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" @@ -1100,9 +1099,6 @@ void ExistingUserController::SendAccessibilityAlert( AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); SendControlAccessibilityNotification( ui::AX_EVENT_VALUE_CHANGED, &event); - - AutomationManagerAsh::GetInstance()->HandleAlert( - ProfileHelper::GetSigninProfile(), alert_text); } void ExistingUserController::SetPublicSessionKeyboardLayoutAndLogin( diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index 907d8a7..4aa2227 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -356,11 +356,19 @@ void ComponentLoader::AddChromeVoxExtension( resources_path.Append(extension_misc::kChromeVoxExtensionPath); const CommandLine* command_line = CommandLine::ForCurrentProcess(); + bool is_chromevox_next = + command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext); bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); - const char* manifest_filename = - is_guest ? extension_misc::kChromeVoxGuestManifestFilename - : extension_misc::kChromeVoxManifestFilename; - + const char* manifest_filename; + if (is_chromevox_next) { + manifest_filename = + is_guest ? extension_misc::kChromeVoxNextGuestManifestFilename + : extension_misc::kChromeVoxNextManifestFilename; + } else { + manifest_filename = + is_guest ? extension_misc::kChromeVoxGuestManifestFilename + : extension_misc::kChromeVoxManifestFilename; + } BrowserThread::PostTaskAndReplyWithResult( BrowserThread::FILE, FROM_HERE, diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox.gyp b/chrome/browser/resources/chromeos/chromevox/chromevox.gyp index cf72970..760675f 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox.gyp +++ b/chrome/browser/resources/chromeos/chromevox/chromevox.gyp @@ -24,8 +24,10 @@ 'type': 'none', 'dependencies': [ 'chromevox_resources', - 'chromevox_manifest', - 'chromevox_guest_manifest', + 'chromevox1_manifest', + 'chromevox1_guest_manifest', + 'chromevox2_manifest', + 'chromevox2_guest_manifest', ], }, { @@ -154,9 +156,8 @@ ], 'includes': ['generate_deps.gypi'], }, - # Used for webstore releases. { - 'target_name': 'chromevox_webstore_manifest', + 'target_name': 'chromevox1_manifest', 'type': 'none', 'variables': { 'output_manifest_path': '<(chromevox_dest_dir)/manifest.json', @@ -164,23 +165,30 @@ 'includes': [ 'generate_manifest.gypi', ], }, { - 'target_name': 'chromevox_manifest', + 'target_name': 'chromevox1_guest_manifest', 'type': 'none', 'variables': { - 'output_manifest_path': '<(chromevox_dest_dir)/manifest.json', - # TODO(dtseng): Flip this to 1 once ChromeVox Next is ready. - 'is_chromevox_next': 0, + 'output_manifest_path': '<(chromevox_dest_dir)/manifest_guest.json', + 'is_guest_manifest': 1, }, 'includes': [ 'generate_manifest.gypi', ], }, { - 'target_name': 'chromevox_guest_manifest', + 'target_name': 'chromevox2_manifest', 'type': 'none', 'variables': { - 'output_manifest_path': '<(chromevox_dest_dir)/manifest_guest.json', + 'output_manifest_path': '<(chromevox_dest_dir)/manifest_next.json', + 'is_chromevox_next': 1, + }, + 'includes': [ 'generate_manifest.gypi', ], + }, + { + 'target_name': 'chromevox2_guest_manifest', + 'type': 'none', + 'variables': { + 'output_manifest_path': '<(chromevox_dest_dir)/manifest_next_guest.json', 'is_guest_manifest': 1, - # TODO(dtseng): Flip this to 1 once ChromeVox Next is ready. - 'is_chromevox_next': 0, + 'is_chromevox_next': 1, }, 'includes': [ 'generate_manifest.gypi', ], }, diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js index fb803d1..aaccf06 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js @@ -122,14 +122,21 @@ cvox.ChromeVoxBackground.prototype.init = function() { }); var self = this; - - // Inject the content script into all running tabs. - chrome.windows.getAll({'populate': true}, function(windows) { - for (var i = 0; i < windows.length; i++) { - var tabs = windows[i].tabs; - self.injectChromeVoxIntoTabs(tabs); - } - }); + if (chrome.commandLinePrivate) { + chrome.commandLinePrivate.hasSwitch('enable-chromevox-next', + goog.bind(function(result) { + if (result) { + return; + } + // Inject the content script into all running tabs. + chrome.windows.getAll({'populate': true}, function(windows) { + for (var i = 0; i < windows.length; i++) { + var tabs = windows[i].tabs; + self.injectChromeVoxIntoTabs(tabs); + } + }); + }, this)); + } if (localStorage['active'] == 'false') { // Warn the user when the browser first starts if ChromeVox is inactive. diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi b/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi index 1831c9e..5334686 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi +++ b/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi @@ -172,11 +172,10 @@ 'chromevox/injected/live_regions_test.unitjs', 'chromevox/injected/user_commands_test.unitjs', 'chromevox/injected/navigation_manager_test.unitjs', - # TODO(dtseng): Disable pending flip to ChromeVox Next. - #'cvox2/background/automation_util_test.extjs', - #'cvox2/background/background_test.extjs', - #'cvox2/background/cursors_test.extjs', - #'cvox2/background/output_test.extjs', + 'cvox2/background/automation_util_test.extjs', + 'cvox2/background/background_test.extjs', + 'cvox2/background/cursors_test.extjs', + 'cvox2/background/output_test.extjs', 'host/chrome/braille_display_manager_test.unitjs', 'host/chrome/braille_input_handler_test.unitjs', 'host/chrome/braille_integration_test.unitjs', diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js index d5d9956..66139d9 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js @@ -181,9 +181,7 @@ AutomationUtil.getDivergence = function(ancestorsA, ancestorsB) { if (ancestorsA[i] !== ancestorsB[i]) return i; } - if (ancestorsA.length == ancestorsB.length) - return -1; - return ancestorsA.length; + return -1; }; /** diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js index 55267e6..27b173d 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js @@ -86,13 +86,10 @@ Background = function() { this.listeners_ = { alert: this.onEventDefault, focus: this.onEventDefault, - hover: this.onEventDefault, menuStart: this.onEventDefault, menuEnd: this.onEventDefault, loadComplete: this.onLoadComplete, - textChanged: this.onTextOrTextSelectionChanged, - textSelectionChanged: this.onTextOrTextSelectionChanged, - valueChanged: this.onEventDefault + textSelectionChanged: this.onTextSelectionChanged }; // Register listeners for ... @@ -101,6 +98,9 @@ Background = function() { // Tabs. chrome.tabs.onUpdated.addListener(this.onTabUpdated); + + // Commands. + chrome.commands.onCommand.addListener(this.onGotCommand); }; Background.prototype = { @@ -117,11 +117,6 @@ Background.prototype = { return; var next = this.isWhitelisted_(tab.url); - - // Only care about Next for now. - if (!next) - return; - this.toggleChromeVoxVersion({next: next, classic: !next}); }.bind(this)); }, @@ -244,17 +239,11 @@ Background.prototype = { */ onEventDefault: function(evt) { var node = evt.target; - if (!node) return; var prevRange = this.currentRange_; this.currentRange_ = cursors.Range.fromNode(node); - - // Don't process nodes inside of web content if ChromeVox Next is inactive. - if (node.root.role != chrome.automation.RoleType.desktop && !this.active_) - return; - new Output(this.currentRange_, prevRange, evt.type); }, @@ -277,14 +266,9 @@ Background.prototype = { * Provides all feedback once a text selection change event fires. * @param {Object} evt */ - onTextOrTextSelectionChanged: function(evt) { - if (!this.currentRange_) { - if (!evt.target.state.focused) - return; - - this.onEventDefault(evt); + onTextSelectionChanged: function(evt) { + if (!this.currentRange_) this.currentRange_ = cursors.Range.fromNode(evt.target); - } var textChangeEvent = new cvox.TextChangeEvent( evt.target.attributes.value, @@ -303,7 +287,6 @@ Background.prototype = { } this.editableTextHandler.changed(textChangeEvent); - new Output(this.currentRange_, null, evt.type, {braille: true}); }, /** @@ -340,16 +323,9 @@ Background.prototype = { } if (opt_options.next) { - if (!chrome.commands.onCommand.hasListener(this.onGotCommand)) - chrome.commands.onCommand.addListener(this.onGotCommand); - - if (!this.active_) - chrome.automation.getTree(this.onGotTree); + chrome.automation.getTree(this.onGotTree); this.active_ = true; } else { - if (chrome.commands.onCommand.hasListener(this.onGotCommand)) - chrome.commands.onCommand.removeListener(this.onGotCommand); - if (this.active_) { for (var eventType in this.listeners_) { this.currentRange_.getStart().getNode().root.removeEventListener( diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js index 909a0aa..8ed8599 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js @@ -41,12 +41,9 @@ var Dir = AutomationUtil.Dir; * @param {!cursors.Range} range * @param {cursors.Range} prevRange * @param {chrome.automation.EventType|Output.EventType} type - * @param {{braille: (boolean|undefined), speech: (boolean|undefined)}=} - * opt_options * @constructor */ -Output = function(range, prevRange, type, opt_options) { - opt_options = opt_options || {braille: true, speech: true}; +Output = function(range, prevRange, type) { // TODO(dtseng): Include braille specific rules. /** @type {!cvox.Spannable} */ this.buffer_ = new cvox.Spannable(); @@ -62,10 +59,8 @@ Output = function(range, prevRange, type, opt_options) { this.formatOptions_ = {speech: true, braille: false, location: true}; this.render_(range, prevRange, type); - if (opt_options.speech) - this.handleSpeech(); - if (opt_options.braille) - this.handleBraille(); + this.handleSpeech(); + this.handleBraille(); this.handleDisplay(); }; @@ -98,9 +93,6 @@ Output.RULES = { '$earcon(CHECK_ON, @input_type_checkbox), ' + '$earcon(CHECK_OFF, @input_type_checkbox))' }, - dialog: { - enter: '$name $role' - }, heading: { enter: '@aria_role_heading', speak: '@aria_role_heading $name=' @@ -155,11 +147,7 @@ Output.RULES = { textField: { speak: '$name $value $earcon(EDITABLE_TEXT, @input_type_text)' }, - toolbar: { - enter: '$name $role' - }, window: { - enter: '$name', speak: '@describe_window($name) $earcon(OBJECT_OPEN)' } }, @@ -404,7 +392,7 @@ Output.prototype = { */ range_: function(range, prevRange, type, rangeBuff) { if (!prevRange) - prevRange = cursors.Range.fromNode(range.getStart().getNode().root); + prevRange = range; var cursor = range.getStart(); var prevNode = prevRange.getStart().getNode(); diff --git a/chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 b/chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 index 4f223a9..7cc62e0 100644 --- a/chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 +++ b/chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 @@ -33,12 +33,11 @@ "virtualKeyboardPrivate", "<all_urls>" ], +{% if is_chromevox_next == '0' %} "content_scripts": [ { "matches": [ "<all_urls>" ], - "exclude_globs": [ - "chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromevox/background/background.html" - ], + "exclude_globs": [ "chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromevox/background/background.html" ], "all_frames": true, "js": [ {% if is_js_compressed == '1' %} @@ -52,6 +51,7 @@ ] } ], +{% endif %} "web_accessible_resources": [ "chromevox/injected/api.js", "chromevox/injected/api_util.js", diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js index e432a998..778a413 100644 --- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js +++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js @@ -27,6 +27,20 @@ ChromeVoxNextE2ETest.prototype = { testGenCppIncludes: function() { ChromeVoxE2ETest.prototype.testGenCppIncludes.call(this); GEN('#include "base/command_line.h"'); + GEN('#include "chromeos/chromeos_switches.h"'); + }, + + /** + * This method is called without |this| bound to an instance of + * ChromeVoxNextE2ETest. + * @override + */ + testGenPreamble: function() { + GEN_BLOCK(function() {/*! + CommandLine* command_line = CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(chromeos::switches::kEnableChromeVoxNext); + */}); + ChromeVoxE2ETest.prototype.testGenPreamble.call(this); }, runWithAutomation: function(doc, callback) { diff --git a/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc b/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc index 9db0634..205efca 100644 --- a/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc +++ b/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc @@ -12,7 +12,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "content/public/browser/ax_event_notification_details.h" #include "content/public/browser/browser_context.h" -#include "ui/aura/window.h" #include "ui/views/accessibility/ax_aura_obj_cache.h" #include "ui/views/accessibility/ax_aura_obj_wrapper.h" #include "ui/views/view.h" @@ -43,12 +42,13 @@ void AutomationManagerAsh::Disable() { void AutomationManagerAsh::HandleEvent(BrowserContext* context, views::View* view, ui::AXEvent event_type) { - if (!enabled_) + if (!enabled_) { return; + } - if (!context && g_browser_process->profile_manager()) + if (!context && g_browser_process->profile_manager()) { context = g_browser_process->profile_manager()->GetLastUsedProfile(); - + } if (!context) { LOG(WARNING) << "Accessibility notification but no browser context"; return; @@ -59,17 +59,6 @@ void AutomationManagerAsh::HandleEvent(BrowserContext* context, SendEvent(context, aura_obj, event_type); } -void AutomationManagerAsh::HandleAlert(content::BrowserContext* context, - const std::string& text) { - if (!enabled_) - return; - - views::AXAuraObjWrapper* obj = - static_cast<AXRootObjWrapper*>(current_tree_->GetRoot()) - ->GetAlertForText(text); - SendEvent(context, obj, ui::AX_EVENT_ALERT); -} - void AutomationManagerAsh::DoDefault(int32 id) { CHECK(enabled_); current_tree_->DoDefault(id); diff --git a/chrome/browser/ui/ash/accessibility/automation_manager_ash.h b/chrome/browser/ui/ash/accessibility/automation_manager_ash.h index 85dfad9..1dbee1e 100644 --- a/chrome/browser/ui/ash/accessibility/automation_manager_ash.h +++ b/chrome/browser/ui/ash/accessibility/automation_manager_ash.h @@ -39,8 +39,6 @@ class AutomationManagerAsh : public extensions::AutomationActionAdapter { views::View* view, ui::AXEvent event_type); - void HandleAlert(content::BrowserContext* context, const std::string& text); - // AutomationActionAdapter implementation. void DoDefault(int32 id) override; void Focus(int32 id) override; diff --git a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc index 1448a211..0a2246aa 100644 --- a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc +++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc @@ -5,37 +5,15 @@ #include "chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h" #include "ash/shell.h" -#include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_view_state.h" #include "ui/aura/window.h" #include "ui/views/accessibility/ax_aura_obj_cache.h" -namespace { -class AlertWindow : public aura::Window { - public: - AlertWindow() : aura::Window(NULL) {} - virtual ~AlertWindow() {} -}; - -} // namespace - -AXRootObjWrapper::AXRootObjWrapper(int32 id) - : id_(id), alert_window_(new AlertWindow()) { +AXRootObjWrapper::AXRootObjWrapper(int32 id) : id_(id) { } -AXRootObjWrapper::~AXRootObjWrapper() { - if (alert_window_) { - delete alert_window_; - alert_window_ = NULL; - } -} - -views::AXAuraObjWrapper* AXRootObjWrapper::GetAlertForText( - const std::string& text) { - alert_window_->SetTitle(base::UTF8ToUTF16((text))); - return views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_); -} +AXRootObjWrapper::~AXRootObjWrapper() {} bool AXRootObjWrapper::HasChild(views::AXAuraObjWrapper* child) { std::vector<views::AXAuraObjWrapper*> children; @@ -59,9 +37,6 @@ void AXRootObjWrapper::GetChildren( out_children->push_back( views::AXAuraObjCache::GetInstance()->GetOrCreate(children[i])); } - - out_children->push_back( - views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_)); } void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) { diff --git a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h index 72883dc..4007cbb4 100644 --- a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h +++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h @@ -5,23 +5,14 @@ #ifndef CHROME_BROWSER_UI_ASH_ACCESSIBILITY_AX_ROOT_OBJ_WRAPPER_H_ #define CHROME_BROWSER_UI_ASH_ACCESSIBILITY_AX_ROOT_OBJ_WRAPPER_H_ -#include <string> - #include "base/basictypes.h" #include "ui/views/accessibility/ax_aura_obj_wrapper.h" -namespace { -class AlertWindow; -} // namespace - class AXRootObjWrapper : public views::AXAuraObjWrapper { public: explicit AXRootObjWrapper(int32 id); ~AXRootObjWrapper() override; - // Returns an AXAuraObjWrapper for an alert window with title set to |text|. - views::AXAuraObjWrapper* GetAlertForText(const std::string& text); - // Convenience method to check for existence of a child. bool HasChild(views::AXAuraObjWrapper* child); @@ -35,8 +26,6 @@ class AXRootObjWrapper : public views::AXAuraObjWrapper { private: int32 id_; - AlertWindow* alert_window_; - DISALLOW_COPY_AND_ASSIGN(AXRootObjWrapper); }; diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc index 6d44e95..73ebc91 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc @@ -23,7 +23,6 @@ #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" #include "chrome/browser/speech/tts_controller.h" #include "chrome/browser/sync/sync_error_notifier_factory_ash.h" -#include "chrome/browser/ui/ash/accessibility/automation_manager_ash.h" #include "chrome/browser/ui/ash/chrome_new_window_delegate_chromeos.h" #include "chrome/browser/ui/ash/media_delegate_chromeos.h" #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" @@ -183,8 +182,6 @@ class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); SendControlAccessibilityNotification( ui::AX_EVENT_ALERT, &event); - AutomationManagerAsh::GetInstance()->HandleAlert( - profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); break; } case ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { @@ -193,9 +190,6 @@ class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); SendControlAccessibilityNotification( ui::AX_EVENT_ALERT, &event); - AutomationManagerAsh::GetInstance()->HandleAlert( - profile, l10n_util::GetStringUTF8( - IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); break; } case ui::A11Y_ALERT_NONE: diff --git a/chrome/common/extensions/api/_manifest_features.json b/chrome/common/extensions/api/_manifest_features.json index 72aba14..3ff4f1b 100644 --- a/chrome/common/extensions/api/_manifest_features.json +++ b/chrome/common/extensions/api/_manifest_features.json @@ -34,14 +34,10 @@ "channel": "stable", "extension_types": "all" }, - "automation": [{ + "automation": { "channel": "dev", "extension_types": ["extension", "legacy_packaged_app"] - }, { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], - "whitelist": [ "2FCBCE08B34CCA1728A85F1EFBD9A34DD2558B2E" ] - }], + }, "browser_action": { "channel": "stable", "extension_types": ["extension"] diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc index 4f73429..eee274c 100644 --- a/chrome/common/extensions/extension_constants.cc +++ b/chrome/common/extensions/extension_constants.cc @@ -66,6 +66,8 @@ const char kChromeVoxExtensionId[] = const char kChromeVoxExtensionPath[] = "chromeos/chromevox"; const char kChromeVoxManifestFilename[] = "manifest.json"; const char kChromeVoxGuestManifestFilename[] = "manifest_guest.json"; +const char kChromeVoxNextManifestFilename[] = "manifest_next.json"; +const char kChromeVoxNextGuestManifestFilename[] = "manifest_next_guest.json"; const char kBrailleImeExtensionId[] = "jddehjeebkoimngcbdkaahpobgicbffp"; const char kBrailleImeExtensionPath[] = diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h index cc3dbf7..b5e93cc 100644 --- a/chrome/common/extensions/extension_constants.h +++ b/chrome/common/extensions/extension_constants.h @@ -206,6 +206,10 @@ extern const char kChromeVoxExtensionPath[]; extern const char kChromeVoxManifestFilename[]; // Name of ChromeVox guest manifest file. extern const char kChromeVoxGuestManifestFilename[]; +// Name of ChromeVox next manifest file. +extern const char kChromeVoxNextManifestFilename[]; +// Name of ChromeVox next guest manifest file. +extern const char kChromeVoxNextGuestManifestFilename[]; // Extension id, path (relative to |chrome::DIR_RESOURCES|) and IME engine // id for the builtin-in Braille IME extension. extern const char kBrailleImeExtensionId[]; diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index 403d6ed..739ca06 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -75,6 +75,9 @@ const char kDisableNetworkPortalNotification[] = // Enables switching between different cellular carriers from the UI. const char kEnableCarrierSwitching[] = "enable-carrier-switching"; +// Enables the next generation version of ChromeVox. +const char kEnableChromeVoxNext[] = "enable-chromevox-next"; + // Enables cloud backup feature. const char kEnableCloudBackup[] = "enable-cloud-backup"; diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index 275082f..8bc5aa2 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h @@ -43,6 +43,7 @@ CHROMEOS_EXPORT extern const char kDisableOfficeEditingComponentApp[]; CHROMEOS_EXPORT extern const char kDisableRollbackOption[]; CHROMEOS_EXPORT extern const char kDisableVolumeAdjustSound[]; CHROMEOS_EXPORT extern const char kEnableCarrierSwitching[]; +CHROMEOS_EXPORT extern const char kEnableChromeVoxNext[]; CHROMEOS_EXPORT extern const char kEnableCloudBackup[]; CHROMEOS_EXPORT extern const char kEnableConsumerManagement[]; CHROMEOS_EXPORT extern const char kEnableEmbeddedSignin[]; diff --git a/ui/views/accessibility/ax_window_obj_wrapper.cc b/ui/views/accessibility/ax_window_obj_wrapper.cc index ac04582..b358de5 100644 --- a/ui/views/accessibility/ax_window_obj_wrapper.cc +++ b/ui/views/accessibility/ax_window_obj_wrapper.cc @@ -49,13 +49,8 @@ void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) { // TODO(dtseng): Set better states. out_node_data->state = 0; out_node_data->location = window_->bounds(); - - // Root windows currently have a non readable name (e.g. Display1234...); - // ignore them unless the window is the only node in the tree. - if (window_->parent() || window_->children().size() == 0) { - out_node_data->AddStringAttribute(ui::AX_ATTR_NAME, - base::UTF16ToUTF8(window_->title())); - } + out_node_data->AddStringAttribute( + ui::AX_ATTR_NAME, base::UTF16ToUTF8(window_->title())); } int32 AXWindowObjWrapper::GetID() { |