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

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

Issue 2372253003: Account for device scale factor in automation API bounding boxes. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/automation_internal/automation_internal_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/common/extensions/api/automation_api_constants.h"
15 #include "chrome/common/extensions/api/automation_internal.h" 16 #include "chrome/common/extensions/api/automation_internal.h"
16 #include "chrome/common/extensions/chrome_extension_messages.h" 17 #include "chrome/common/extensions/chrome_extension_messages.h"
17 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
18 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
19 #include "content/public/browser/notification_types.h" 20 #include "content/public/browser/notification_types.h"
20 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
21 #include "extensions/browser/event_router.h" 22 #include "extensions/browser/event_router.h"
22 #include "extensions/common/extension.h" 23 #include "extensions/common/extension.h"
23 #include "ui/accessibility/ax_enums.h" 24 #include "ui/accessibility/ax_enums.h"
24 #include "ui/accessibility/ax_node_data.h" 25 #include "ui/accessibility/ax_node_data.h"
(...skipping 30 matching lines...) Expand all
55 false); 56 false);
56 } 57 }
57 58
58 void AutomationEventRouter::RegisterListenerWithDesktopPermission( 59 void AutomationEventRouter::RegisterListenerWithDesktopPermission(
59 const ExtensionId& extension_id, 60 const ExtensionId& extension_id,
60 int listener_process_id, 61 int listener_process_id,
61 int listener_routing_id) { 62 int listener_routing_id) {
62 Register(extension_id, 63 Register(extension_id,
63 listener_process_id, 64 listener_process_id,
64 listener_routing_id, 65 listener_routing_id,
65 0 /* desktop tree ID */, 66 api::automation::kDesktopTreeID,
66 true); 67 true);
67 } 68 }
68 69
69 void AutomationEventRouter::DispatchAccessibilityEvent( 70 void AutomationEventRouter::DispatchAccessibilityEvent(
70 const ExtensionMsg_AccessibilityEventParams& params) { 71 const ExtensionMsg_AccessibilityEventParams& params) {
71 if (active_profile_ != ProfileManager::GetActiveUserProfile()) { 72 if (active_profile_ != ProfileManager::GetActiveUserProfile()) {
72 active_profile_ = ProfileManager::GetActiveUserProfile(); 73 active_profile_ = ProfileManager::GetActiveUserProfile();
73 UpdateActiveProfile(); 74 UpdateActiveProfile();
74 } 75 }
75 76
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // only mark one as active. 205 // only mark one as active.
205 listener.is_active_profile = (extension_id_count == 1 || 206 listener.is_active_profile = (extension_id_count == 1 ||
206 rph->GetBrowserContext() == active_profile_); 207 rph->GetBrowserContext() == active_profile_);
207 #else 208 #else
208 listener.is_active_profile = true; 209 listener.is_active_profile = true;
209 #endif 210 #endif
210 } 211 }
211 } 212 }
212 213
213 } // namespace extensions 214 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/automation_internal/automation_internal_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698