| 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/renderer/extensions/automation_internal_custom_bindings.h" | 5 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 if (node == cache->tree.root()) { | 127 if (node == cache->tree.root()) { |
| 128 container = cache->owner->GetParent(node, &cache); | 128 container = cache->owner->GetParent(node, &cache); |
| 129 } else { | 129 } else { |
| 130 container = cache->tree.root(); | 130 container = cache->tree.root(); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 if (!container || container == node) | 134 if (!container || container == node) |
| 135 break; | 135 break; |
| 136 | 136 |
| 137 gfx::RectF container_bounds = ComputeLocalNodeBounds(cache, container); | 137 gfx::RectF container_bounds = container->data().location; |
| 138 bounds.Offset(container_bounds.x(), container_bounds.y()); | 138 bounds.Offset(container_bounds.x(), container_bounds.y()); |
| 139 | 139 |
| 140 int scroll_x = 0; | 140 int scroll_x = 0; |
| 141 int scroll_y = 0; | 141 int scroll_y = 0; |
| 142 if (container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_X, &scroll_x) && | 142 if (container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_X, &scroll_x) && |
| 143 container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_Y, &scroll_y)) { | 143 container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_Y, &scroll_y)) { |
| 144 bounds.Offset(-scroll_x, -scroll_y); | 144 bounds.Offset(-scroll_x, -scroll_y); |
| 145 } | 145 } |
| 146 | 146 |
| 147 node = container; | 147 node = container; |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); | 1331 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); |
| 1332 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); | 1332 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); |
| 1333 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); | 1333 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); |
| 1334 args->Set(1U, nodes); | 1334 args->Set(1U, nodes); |
| 1335 for (size_t i = 0; i < ids.size(); ++i) | 1335 for (size_t i = 0; i < ids.size(); ++i) |
| 1336 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); | 1336 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); |
| 1337 context()->DispatchEvent("automationInternal.onNodesRemoved", args); | 1337 context()->DispatchEvent("automationInternal.onNodesRemoved", args); |
| 1338 } | 1338 } |
| 1339 | 1339 |
| 1340 } // namespace extensions | 1340 } // namespace extensions |
| OLD | NEW |