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 "chrome/browser/accessibility/accessibility_extension_api.h" | 5 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 DispatchEvent(info->profile(), | 187 DispatchEvent(info->profile(), |
188 accessibility_private::OnMenuClosed::kEventName, | 188 accessibility_private::OnMenuClosed::kEventName, |
189 args.Pass()); | 189 args.Pass()); |
190 } | 190 } |
191 | 191 |
192 void ExtensionAccessibilityEventRouter::OnChromeVoxLoadStateChanged( | 192 void ExtensionAccessibilityEventRouter::OnChromeVoxLoadStateChanged( |
193 Profile* profile, | 193 Profile* profile, |
194 bool loading, | 194 bool loading, |
195 bool make_announcements) { | 195 bool make_announcements) { |
196 scoped_ptr<base::ListValue> event_args(new base::ListValue()); | 196 scoped_ptr<base::ListValue> event_args(new base::ListValue()); |
197 event_args->Append(base::Value::CreateBooleanValue(loading)); | 197 event_args->AppendBoolean(loading); |
198 event_args->Append(base::Value::CreateBooleanValue(make_announcements)); | 198 event_args->AppendBoolean(make_announcements); |
199 ExtensionAccessibilityEventRouter::DispatchEventToChromeVox( | 199 ExtensionAccessibilityEventRouter::DispatchEventToChromeVox( |
200 profile, | 200 profile, |
201 accessibility_private::OnChromeVoxLoadStateChanged::kEventName, | 201 accessibility_private::OnChromeVoxLoadStateChanged::kEventName, |
202 event_args.Pass()); | 202 event_args.Pass()); |
203 } | 203 } |
204 | 204 |
205 // Static. | 205 // Static. |
206 void ExtensionAccessibilityEventRouter::DispatchEventToChromeVox( | 206 void ExtensionAccessibilityEventRouter::DispatchEventToChromeVox( |
207 Profile* profile, | 207 Profile* profile, |
208 const char* event_name, | 208 const char* event_name, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 const base::string16 message_text = | 301 const base::string16 message_text = |
302 confirm_infobar_delegate->GetMessageText(); | 302 confirm_infobar_delegate->GetMessageText(); |
303 alert_value->SetString(keys::kMessageKey, message_text); | 303 alert_value->SetString(keys::kMessageKey, message_text); |
304 alerts_value->Append(alert_value); | 304 alerts_value->Append(alert_value); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 SetResult(alerts_value); | 308 SetResult(alerts_value); |
309 return true; | 309 return true; |
310 } | 310 } |
OLD | NEW |