OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/web_ui.h" | 5 #include "content/browser/webui/web_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.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 bool WebUIMessageHandler::ExtractIntegerValue(const ListValue* value, | 222 bool WebUIMessageHandler::ExtractIntegerValue(const ListValue* value, |
223 int* out_int) { | 223 int* out_int) { |
224 std::string string_value; | 224 std::string string_value; |
225 if (value->GetString(0, &string_value)) | 225 if (value->GetString(0, &string_value)) |
226 return base::StringToInt(string_value, out_int); | 226 return base::StringToInt(string_value, out_int); |
227 NOTREACHED(); | 227 NOTREACHED(); |
228 return false; | 228 return false; |
229 } | 229 } |
230 | 230 |
| 231 bool WebUIMessageHandler::ExtractDoubleValue(const ListValue* value, |
| 232 double* out_value) { |
| 233 std::string string_value; |
| 234 if (value->GetString(0, &string_value)) |
| 235 return base::StringToDouble(string_value, out_value); |
| 236 NOTREACHED(); |
| 237 return false; |
| 238 } |
| 239 |
231 string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { | 240 string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { |
232 string16 string16_value; | 241 string16 string16_value; |
233 if (value->GetString(0, &string16_value)) | 242 if (value->GetString(0, &string16_value)) |
234 return string16_value; | 243 return string16_value; |
235 NOTREACHED(); | 244 NOTREACHED(); |
236 return string16(); | 245 return string16(); |
237 } | 246 } |
OLD | NEW |