| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 BrowserContext* context = rwhi->GetProcess()->GetBrowserContext(); | 109 BrowserContext* context = rwhi->GetProcess()->GetBrowserContext(); |
| 110 if (context != current_context) | 110 if (context != current_context) |
| 111 continue; | 111 continue; |
| 112 | 112 |
| 113 RenderViewHost* rvh = RenderViewHost::From(widget); | 113 RenderViewHost* rvh = RenderViewHost::From(widget); |
| 114 rvh_list->Append(BuildTargetDescriptor(rvh)); | 114 rvh_list->Append(BuildTargetDescriptor(rvh)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 117 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 118 data->Set("list", rvh_list.release()); | 118 data->Set("list", rvh_list.release()); |
| 119 scoped_ptr<base::FundamentalValue> a11y_mode(base::Value::CreateIntegerValue( | 119 data->SetInteger( |
| 120 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode())); | 120 "global_a11y_mode", |
| 121 data->Set("global_a11y_mode", a11y_mode.release()); | 121 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()); |
| 122 | 122 |
| 123 std::string json_string; | 123 std::string json_string; |
| 124 base::JSONWriter::Write(data.get(), &json_string); | 124 base::JSONWriter::Write(data.get(), &json_string); |
| 125 | 125 |
| 126 callback.Run(base::RefCountedString::TakeString(&json_string)); | 126 callback.Run(base::RefCountedString::TakeString(&json_string)); |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace | 130 } // namespace |
| 131 | 131 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 formatter->SetFilters(filters); | 246 formatter->SetFilters(filters); |
| 247 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); | 247 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); |
| 248 | 248 |
| 249 result->Set("tree", | 249 result->Set("tree", |
| 250 new base::StringValue( | 250 new base::StringValue( |
| 251 base::UTF16ToUTF8(accessibility_contents_utf16))); | 251 base::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 |