| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/ash/accessibility/automation_manager_ash.h" | 5 #include "chrome/browser/ui/ash/accessibility/automation_manager_ash.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 current_tree_serializer_->Reset(); | 37 current_tree_serializer_->Reset(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void AutomationManagerAsh::HandleEvent(BrowserContext* context, | 40 void AutomationManagerAsh::HandleEvent(BrowserContext* context, |
| 41 views::View* view, | 41 views::View* view, |
| 42 ui::AXEvent event_type) { | 42 ui::AXEvent event_type) { |
| 43 if (!enabled_) { | 43 if (!enabled_) { |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // TODO(dtseng): Events should only be delivered to extensions with the | |
| 48 // desktop permission. | |
| 49 views::Widget* widget = view->GetWidget(); | 47 views::Widget* widget = view->GetWidget(); |
| 50 if (!widget) | 48 if (!widget) |
| 51 return; | 49 return; |
| 52 | 50 |
| 53 if (!context && g_browser_process->profile_manager()) { | 51 if (!context && g_browser_process->profile_manager()) { |
| 54 context = g_browser_process->profile_manager()->GetLastUsedProfile(); | 52 context = g_browser_process->profile_manager()->GetLastUsedProfile(); |
| 55 } | 53 } |
| 56 if (!context) { | 54 if (!context) { |
| 57 LOG(WARNING) << "Accessibility notification but no browser context"; | 55 LOG(WARNING) << "Accessibility notification but no browser context"; |
| 58 return; | 56 return; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 update.nodes, | 105 update.nodes, |
| 108 event_type, | 106 event_type, |
| 109 aura_obj->GetID(), | 107 aura_obj->GetID(), |
| 110 0, /* process_id */ | 108 0, /* process_id */ |
| 111 0 /* routing_id */); | 109 0 /* routing_id */); |
| 112 std::vector<content::AXEventNotificationDetails> details; | 110 std::vector<content::AXEventNotificationDetails> details; |
| 113 details.push_back(detail); | 111 details.push_back(detail); |
| 114 extensions::automation_util::DispatchAccessibilityEventsToAutomation( | 112 extensions::automation_util::DispatchAccessibilityEventsToAutomation( |
| 115 details, context, gfx::Vector2d()); | 113 details, context, gfx::Vector2d()); |
| 116 } | 114 } |
| OLD | NEW |