| Index: chrome/browser/ui/ash/accessibility/automation_manager_ash.cc
|
| diff --git a/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc b/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc
|
| index 205efca63c183ac86b37f21f7db1e58606b94c37..9db0634ec2e90c6fd4a64b3223f1fb98412c034c 100644
|
| --- a/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc
|
| +++ b/chrome/browser/ui/ash/accessibility/automation_manager_ash.cc
|
| @@ -12,6 +12,7 @@
|
| #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"
|
| @@ -42,13 +43,12 @@ 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,6 +59,17 @@ 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);
|
|
|