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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::string title; | 67 std::string title; |
68 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rvh); | 68 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rvh); |
69 AccessibilityMode accessibility_mode = rwhi->accessibility_mode(); | 69 AccessibilityMode accessibility_mode = rwhi->accessibility_mode(); |
70 | 70 |
71 GURL url; | 71 GURL url; |
72 GURL favicon_url; | 72 GURL favicon_url; |
73 if (web_contents) { | 73 if (web_contents) { |
74 url = web_contents->GetURL(); | 74 url = web_contents->GetURL(); |
75 title = UTF16ToUTF8(web_contents->GetTitle()); | 75 title = UTF16ToUTF8(web_contents->GetTitle()); |
76 NavigationController& controller = web_contents->GetController(); | 76 NavigationController& controller = web_contents->GetController(); |
77 NavigationEntry* entry = controller.GetActiveEntry(); | 77 NavigationEntry* entry = controller.GetVisibleEntry(); |
78 if (entry != NULL && entry->GetURL().is_valid()) | 78 if (entry != NULL && entry->GetURL().is_valid()) |
79 favicon_url = entry->GetFavicon().url; | 79 favicon_url = entry->GetFavicon().url; |
80 } | 80 } |
81 | 81 |
82 return BuildTargetDescriptor(url, | 82 return BuildTargetDescriptor(url, |
83 title, | 83 title, |
84 favicon_url, | 84 favicon_url, |
85 rvh->GetProcess()->GetID(), | 85 rvh->GetProcess()->GetID(), |
86 rvh->GetRoutingID(), | 86 rvh->GetRoutingID(), |
87 accessibility_mode); | 87 accessibility_mode); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 AccessibilityTreeFormatter::Filter::ALLOW)); | 244 AccessibilityTreeFormatter::Filter::ALLOW)); |
245 formatter->SetFilters(filters); | 245 formatter->SetFilters(filters); |
246 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); | 246 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); |
247 | 247 |
248 result->Set("tree", | 248 result->Set("tree", |
249 new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); | 249 new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); |
250 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); | 250 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); |
251 } | 251 } |
252 | 252 |
253 } // namespace content | 253 } // namespace content |
OLD | NEW |