| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 NULL, &tab_strip, &contents, &tab_index)) { | 206 NULL, &tab_strip, &contents, &tab_index)) { |
| 207 error_ = extensions::ErrorUtils::FormatErrorMessage( | 207 error_ = extensions::ErrorUtils::FormatErrorMessage( |
| 208 extensions::tabs_constants::kTabNotFoundError, | 208 extensions::tabs_constants::kTabNotFoundError, |
| 209 base::IntToString(tab_id)); | 209 base::IntToString(tab_id)); |
| 210 return false; | 210 return false; |
| 211 } | 211 } |
| 212 | 212 |
| 213 ListValue* alerts_value = new ListValue; | 213 ListValue* alerts_value = new ListValue; |
| 214 | 214 |
| 215 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 215 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
| 216 for (size_t i = 0; i < infobar_service->GetInfoBarCount(); ++i) { | 216 for (size_t i = 0; i < infobar_service->infobar_count(); ++i) { |
| 217 // TODO(hashimoto): Make other kind of alerts available. crosbug.com/24281 | 217 // TODO(hashimoto): Make other kind of alerts available. crosbug.com/24281 |
| 218 ConfirmInfoBarDelegate* confirm_infobar_delegate = | 218 ConfirmInfoBarDelegate* confirm_infobar_delegate = |
| 219 infobar_service->GetInfoBarDelegateAt(i)->AsConfirmInfoBarDelegate(); | 219 infobar_service->infobar_at(i)->AsConfirmInfoBarDelegate(); |
| 220 if (confirm_infobar_delegate) { | 220 if (confirm_infobar_delegate) { |
| 221 DictionaryValue* alert_value = new DictionaryValue; | 221 DictionaryValue* alert_value = new DictionaryValue; |
| 222 const string16 message_text = confirm_infobar_delegate->GetMessageText(); | 222 const string16 message_text = confirm_infobar_delegate->GetMessageText(); |
| 223 alert_value->SetString(keys::kMessageKey, message_text); | 223 alert_value->SetString(keys::kMessageKey, message_text); |
| 224 alerts_value->Append(alert_value); | 224 alerts_value->Append(alert_value); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 SetResult(alerts_value); | 228 SetResult(alerts_value); |
| 229 return true; | 229 return true; |
| 230 } | 230 } |
| OLD | NEW |