Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/browser/extensions/api/automation_internal/automation_event_router.cc

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: |window| can be nullptr Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/automation_internal/automation_event_rou ter.h" 5 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 content::RenderProcessHost::FromID(listener.process_id); 102 content::RenderProcessHost::FromID(listener.process_id);
103 rph->Send(new ExtensionMsg_AccessibilityLocationChange( 103 rph->Send(new ExtensionMsg_AccessibilityLocationChange(
104 listener.routing_id, 104 listener.routing_id,
105 params)); 105 params));
106 } 106 }
107 } 107 }
108 108
109 void AutomationEventRouter::DispatchTreeDestroyedEvent( 109 void AutomationEventRouter::DispatchTreeDestroyedEvent(
110 int tree_id, 110 int tree_id,
111 content::BrowserContext* browser_context) { 111 content::BrowserContext* browser_context) {
112 browser_context = browser_context ? browser_context : active_profile_;
112 std::unique_ptr<base::ListValue> args( 113 std::unique_ptr<base::ListValue> args(
113 api::automation_internal::OnAccessibilityTreeDestroyed::Create(tree_id)); 114 api::automation_internal::OnAccessibilityTreeDestroyed::Create(tree_id));
114 std::unique_ptr<Event> event(new Event( 115 std::unique_ptr<Event> event(new Event(
115 events::AUTOMATION_INTERNAL_ON_ACCESSIBILITY_TREE_DESTROYED, 116 events::AUTOMATION_INTERNAL_ON_ACCESSIBILITY_TREE_DESTROYED,
116 api::automation_internal::OnAccessibilityTreeDestroyed::kEventName, 117 api::automation_internal::OnAccessibilityTreeDestroyed::kEventName,
117 std::move(args))); 118 std::move(args)));
118 event->restrict_to_browser_context = browser_context; 119 event->restrict_to_browser_context = browser_context;
119 EventRouter::Get(browser_context)->BroadcastEvent(std::move(event)); 120 EventRouter::Get(browser_context)->BroadcastEvent(std::move(event));
120 } 121 }
121 122
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // only mark one as active. 206 // only mark one as active.
206 listener.is_active_profile = (extension_id_count == 1 || 207 listener.is_active_profile = (extension_id_count == 1 ||
207 rph->GetBrowserContext() == active_profile_); 208 rph->GetBrowserContext() == active_profile_);
208 #else 209 #else
209 listener.is_active_profile = true; 210 listener.is_active_profile = true;
210 #endif 211 #endif
211 } 212 }
212 } 213 }
213 214
214 } // namespace extensions 215 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698