OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 UpdateAccessibilityModeOnFrame(pending_frame_host); | 967 UpdateAccessibilityModeOnFrame(pending_frame_host); |
968 } | 968 } |
969 } | 969 } |
970 | 970 |
971 void WebContentsImpl::AddAccessibilityMode(AccessibilityMode mode) { | 971 void WebContentsImpl::AddAccessibilityMode(AccessibilityMode mode) { |
972 AccessibilityMode new_mode(accessibility_mode_); | 972 AccessibilityMode new_mode(accessibility_mode_); |
973 new_mode |= mode; | 973 new_mode |= mode; |
974 SetAccessibilityMode(new_mode); | 974 SetAccessibilityMode(new_mode); |
975 } | 975 } |
976 | 976 |
977 void WebContentsImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback) { | 977 void WebContentsImpl::RequestAXTreeSnapshot( |
| 978 const AXTreeSnapshotCallback& callback) { |
978 // Send a request to each of the frames in parallel. Each one will return | 979 // Send a request to each of the frames in parallel. Each one will return |
979 // an accessibility tree snapshot, and AXTreeSnapshotCombiner will combine | 980 // an accessibility tree snapshot, and AXTreeSnapshotCombiner will combine |
980 // them into a single tree and call |callback| with that result, then | 981 // them into a single tree and call |callback| with that result, then |
981 // delete |combiner|. | 982 // delete |combiner|. |
982 AXTreeSnapshotCombiner* combiner = new AXTreeSnapshotCombiner(callback); | 983 AXTreeSnapshotCombiner* combiner = new AXTreeSnapshotCombiner(callback); |
983 for (FrameTreeNode* frame_tree_node : frame_tree_.Nodes()) { | 984 for (FrameTreeNode* frame_tree_node : frame_tree_.Nodes()) { |
984 bool is_root = frame_tree_node->parent() == nullptr; | 985 bool is_root = frame_tree_node->parent() == nullptr; |
985 frame_tree_node->current_frame_host()->RequestAXTreeSnapshot( | 986 frame_tree_node->current_frame_host()->RequestAXTreeSnapshot( |
986 combiner->AddFrame(is_root)); | 987 combiner->AddFrame(is_root)); |
987 } | 988 } |
(...skipping 4484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5472 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5473 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
5473 if (!render_view_host) | 5474 if (!render_view_host) |
5474 continue; | 5475 continue; |
5475 render_view_host_set.insert(render_view_host); | 5476 render_view_host_set.insert(render_view_host); |
5476 } | 5477 } |
5477 for (RenderViewHost* render_view_host : render_view_host_set) | 5478 for (RenderViewHost* render_view_host : render_view_host_set) |
5478 render_view_host->OnWebkitPreferencesChanged(); | 5479 render_view_host->OnWebkitPreferencesChanged(); |
5479 } | 5480 } |
5480 | 5481 |
5481 } // namespace content | 5482 } // namespace content |
OLD | NEW |