| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/dom_ui.h" | 5 #include "chrome/browser/dom_ui/dom_ui.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 const ListValue* list_value = static_cast<const ListValue*>(value); | 169 const ListValue* list_value = static_cast<const ListValue*>(value); |
| 170 std::string string_value; | 170 std::string string_value; |
| 171 if (list_value->GetString(0, &string_value)) { | 171 if (list_value->GetString(0, &string_value)) { |
| 172 base::StringToInt(string_value, out_int); | 172 base::StringToInt(string_value, out_int); |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 return false; | 176 return false; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // TODO(viettrungluu): convert to string16 (or UTF-8 std::string?). |
| 179 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { | 180 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { |
| 180 if (value && value->GetType() == Value::TYPE_LIST) { | 181 if (value && value->GetType() == Value::TYPE_LIST) { |
| 181 const ListValue* list_value = static_cast<const ListValue*>(value); | 182 const ListValue* list_value = static_cast<const ListValue*>(value); |
| 182 std::wstring wstring_value; | 183 string16 string16_value; |
| 183 if (list_value->GetString(0, &wstring_value)) | 184 if (list_value->GetString(0, &string16_value)) |
| 184 return wstring_value; | 185 return UTF16ToWideHack(string16_value); |
| 185 } | 186 } |
| 186 return std::wstring(); | 187 return std::wstring(); |
| 187 } | 188 } |
| OLD | NEW |