Commit e6db68f8 authored by James Cook's avatar James Cook Committed by Commit Bot

Add accessibility support to quick_launch test app, fix window frame

This allows testing ChromeVox with multiple simultaneous mash apps.

* Turn on a11y support in AuraInit::InitParams
* Initialize ash window property transport

Bug: 888147, 892743
Change-Id: I3114787aa687dd6a233b7411739fa3f938cf4399
Reviewed-on: https://chromium-review.googlesource.com/c/1265535
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597341}
parent 7130b4a6
...@@ -15,6 +15,7 @@ source_set("lib") { ...@@ -15,6 +15,7 @@ source_set("lib") {
] ]
deps = [ deps = [
"//ash/public/cpp",
"//base", "//base",
"//mash/public/mojom", "//mash/public/mojom",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ash/components/quick_launch/quick_launch_application.h" #include "ash/components/quick_launch/quick_launch_application.h"
#include "ash/public/cpp/ash_client.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/run_loop.h" #include "base/run_loop.h"
...@@ -174,12 +175,16 @@ void QuickLaunchApplication::OnStart() { ...@@ -174,12 +175,16 @@ void QuickLaunchApplication::OnStart() {
params.connector = context()->connector(); params.connector = context()->connector();
params.identity = context()->identity(); params.identity = context()->identity();
params.register_path_provider = running_standalone_; params.register_path_provider = running_standalone_;
params.use_accessibility_host = true;
aura_init_ = views::AuraInit::Create(params); aura_init_ = views::AuraInit::Create(params);
if (!aura_init_) { if (!aura_init_) {
context()->QuitNow(); context()->QuitNow();
return; return;
} }
// Register as a client of the window manager.
ash::ash_client::Init();
catalog::mojom::CatalogPtr catalog; catalog::mojom::CatalogPtr catalog;
context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog); context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog);
......
...@@ -6,15 +6,13 @@ ...@@ -6,15 +6,13 @@
#include "ash/components/shortcut_viewer/last_window_closed_observer.h" #include "ash/components/shortcut_viewer/last_window_closed_observer.h"
#include "ash/components/shortcut_viewer/views/keyboard_shortcut_view.h" #include "ash/components/shortcut_viewer/views/keyboard_shortcut_view.h"
#include "ash/public/cpp/mus_property_mirror_ash.h" #include "ash/public/cpp/ash_client.h"
#include "ash/public/cpp/window_properties.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/service_context.h" #include "services/service_manager/public/cpp/service_context.h"
#include "ui/events/devices/input_device_manager.h" #include "ui/events/devices/input_device_manager.h"
#include "ui/views/mus/aura_init.h" #include "ui/views/mus/aura_init.h"
#include "ui/views/mus/mus_client.h"
namespace keyboard_shortcut_viewer { namespace keyboard_shortcut_viewer {
...@@ -44,15 +42,8 @@ void ShortcutViewerApplication::OnStart() { ...@@ -44,15 +42,8 @@ void ShortcutViewerApplication::OnStart() {
return; return;
} }
views::MusClient* mus_client = views::MusClient::Get(); // Register as a client of the window manager.
aura::WindowTreeClientDelegate* delegate = mus_client; ash::ash_client::Init();
// Registers ash specific window properties to be transported.
ash::RegisterWindowProperties(delegate->GetPropertyConverter());
// Setup property mirror between window and host.
mus_client->SetMusPropertyMirror(
std::make_unique<ash::MusPropertyMirrorAsh>());
// Quit the application when the window is closed. // Quit the application when the window is closed.
last_window_closed_observer_ = std::make_unique<LastWindowClosedObserver>( last_window_closed_observer_ = std::make_unique<LastWindowClosedObserver>(
......
...@@ -32,6 +32,8 @@ component("cpp") { ...@@ -32,6 +32,8 @@ component("cpp") {
"app_list/tokenized_string_match.h", "app_list/tokenized_string_match.h",
"app_menu_constants.h", "app_menu_constants.h",
"app_types.h", "app_types.h",
"ash_client.cc",
"ash_client.h",
"ash_constants.h", "ash_constants.h",
"ash_features.cc", "ash_features.cc",
"ash_features.h", "ash_features.h",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/public/cpp/ash_client.h"
#include "ash/public/cpp/mus_property_mirror_ash.h"
#include "ash/public/cpp/window_properties.h"
#include "ui/views/mus/mus_client.h"
namespace ash {
namespace ash_client {
void Init() {
// Register ash specific window properties to be transported.
views::MusClient* mus_client = views::MusClient::Get();
aura::WindowTreeClientDelegate* delegate = mus_client;
RegisterWindowProperties(delegate->GetPropertyConverter());
// Setup property mirror between window and host.
mus_client->SetMusPropertyMirror(std::make_unique<MusPropertyMirrorAsh>());
}
} // namespace ash_client
} // namespace ash
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_PUBLIC_CPP_ASH_CLIENT_H_
#define ASH_PUBLIC_CPP_ASH_CLIENT_H_
#include "ash/public/cpp/ash_public_export.h"
namespace ash {
namespace ash_client {
// Initializes a client application (e.g. keyboard shortcut viewer) such that
// it can communicate with the ash window manager.
ASH_PUBLIC_EXPORT void Init();
} // namespace ash_client
} // namespace ash
#endif // ASH_PUBLIC_CPP_ASH_CLIENT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment