| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "extensions/common/extension_api.h" | 5 #include "extensions/common/extension_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Tracking down http://crbug.com/121424 | 54 // Tracking down http://crbug.com/121424 |
| 55 char buf[128]; | 55 char buf[128]; |
| 56 base::snprintf(buf, arraysize(buf), "%s: (%d) '%s'", | 56 base::snprintf(buf, arraysize(buf), "%s: (%d) '%s'", |
| 57 name.c_str(), | 57 name.c_str(), |
| 58 result.get() ? result->GetType() : -1, | 58 result.get() ? result->GetType() : -1, |
| 59 error_message.c_str()); | 59 error_message.c_str()); |
| 60 | 60 |
| 61 CHECK(result.get()) << error_message << " for schema " << schema; | 61 CHECK(result.get()) << error_message << " for schema " << schema; |
| 62 CHECK(result->IsType(base::Value::TYPE_LIST)) << " for schema " << schema; | 62 CHECK(result->IsType(base::Value::TYPE_LIST)) << " for schema " << schema; |
| 63 return scoped_ptr<base::ListValue>(static_cast<base::ListValue*>( | 63 return base::ListValue::From(result.Pass()); |
| 64 result.release())); | |
| 65 } | 64 } |
| 66 | 65 |
| 67 const base::DictionaryValue* FindListItem(const base::ListValue* list, | 66 const base::DictionaryValue* FindListItem(const base::ListValue* list, |
| 68 const std::string& property_name, | 67 const std::string& property_name, |
| 69 const std::string& property_value) { | 68 const std::string& property_value) { |
| 70 for (size_t i = 0; i < list->GetSize(); ++i) { | 69 for (size_t i = 0; i < list->GetSize(); ++i) { |
| 71 const base::DictionaryValue* item = NULL; | 70 const base::DictionaryValue* item = NULL; |
| 72 CHECK(list->GetDictionary(i, &item)) | 71 CHECK(list->GetDictionary(i, &item)) |
| 73 << property_value << "/" << property_name; | 72 << property_value << "/" << property_name; |
| 74 std::string value; | 73 std::string value; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 break; | 384 break; |
| 386 | 385 |
| 387 api_name_candidate = api_name_candidate.substr(0, last_dot_index); | 386 api_name_candidate = api_name_candidate.substr(0, last_dot_index); |
| 388 } | 387 } |
| 389 | 388 |
| 390 *child_name = ""; | 389 *child_name = ""; |
| 391 return std::string(); | 390 return std::string(); |
| 392 } | 391 } |
| 393 | 392 |
| 394 } // namespace extensions | 393 } // namespace extensions |
| OLD | NEW |