OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/accessibility/accessibility_ui.h" | 5 #include "content/browser/accessibility/accessibility_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 std::string title; | 68 std::string title; |
69 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rvh); | 69 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rvh); |
70 AccessibilityMode accessibility_mode = rwhi->accessibility_mode(); | 70 AccessibilityMode accessibility_mode = rwhi->accessibility_mode(); |
71 | 71 |
72 GURL url; | 72 GURL url; |
73 GURL favicon_url; | 73 GURL favicon_url; |
74 if (web_contents) { | 74 if (web_contents) { |
75 url = web_contents->GetURL(); | 75 url = web_contents->GetURL(); |
76 title = UTF16ToUTF8(web_contents->GetTitle()); | 76 title = UTF16ToUTF8(web_contents->GetTitle()); |
77 NavigationController& controller = web_contents->GetController(); | 77 NavigationController& controller = web_contents->GetController(); |
78 NavigationEntry* entry = controller.GetActiveEntry(); | 78 NavigationEntry* entry = controller.GetVisibleEntry(); |
79 if (entry != NULL && entry->GetURL().is_valid()) | 79 if (entry != NULL && entry->GetURL().is_valid()) |
80 favicon_url = entry->GetFavicon().url; | 80 favicon_url = entry->GetFavicon().url; |
81 } | 81 } |
82 | 82 |
83 return BuildTargetDescriptor(url, | 83 return BuildTargetDescriptor(url, |
84 title, | 84 title, |
85 favicon_url, | 85 favicon_url, |
86 rvh->GetProcess()->GetID(), | 86 rvh->GetProcess()->GetID(), |
Charlie Reis
2013/09/16 23:10:54
I forget-- did we come to a resolution on this? W
nasko
2013/09/18 17:03:18
I've added a TODO, since this code will need more
| |
87 rvh->GetRoutingID(), | 87 rvh->GetRoutingID(), |
88 accessibility_mode); | 88 accessibility_mode); |
89 } | 89 } |
90 | 90 |
91 void SendTargetsData( | 91 void SendTargetsData( |
92 const WebUIDataSource::GotDataCallback& callback) { | 92 const WebUIDataSource::GotDataCallback& callback) { |
93 scoped_ptr<base::ListValue> rvh_list(new base::ListValue()); | 93 scoped_ptr<base::ListValue> rvh_list(new base::ListValue()); |
94 | 94 |
95 scoped_ptr<RenderWidgetHostIterator> widgets( | 95 scoped_ptr<RenderWidgetHostIterator> widgets( |
96 RenderWidgetHost::GetRenderWidgetHosts()); | 96 RenderWidgetHost::GetRenderWidgetHosts()); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 AccessibilityTreeFormatter::Filter::ALLOW)); | 246 AccessibilityTreeFormatter::Filter::ALLOW)); |
247 formatter->SetFilters(filters); | 247 formatter->SetFilters(filters); |
248 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); | 248 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); |
249 | 249 |
250 result->Set("tree", | 250 result->Set("tree", |
251 new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); | 251 new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); |
252 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); | 252 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); |
253 } | 253 } |
254 | 254 |
255 } // namespace content | 255 } // namespace content |
OLD | NEW |