| 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 "extensions/common/extension_api.h" | 5 #include "extensions/common/extension_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 std::unique_ptr<ExtensionAPI> api( | 795 std::unique_ptr<ExtensionAPI> api( |
| 796 ExtensionAPI::CreateWithDefaultConfiguration()); | 796 ExtensionAPI::CreateWithDefaultConfiguration()); |
| 797 | 797 |
| 798 // Returns the dictionary that has |key|: |value|. | 798 // Returns the dictionary that has |key|: |value|. |
| 799 auto get_dict_from_list = []( | 799 auto get_dict_from_list = []( |
| 800 const base::ListValue* list, const std::string& key, | 800 const base::ListValue* list, const std::string& key, |
| 801 const std::string& value) -> const base::DictionaryValue* { | 801 const std::string& value) -> const base::DictionaryValue* { |
| 802 const base::DictionaryValue* ret = nullptr; | 802 const base::DictionaryValue* ret = nullptr; |
| 803 for (const auto& val : *list) { | 803 for (const auto& val : *list) { |
| 804 const base::DictionaryValue* dict = nullptr; | 804 const base::DictionaryValue* dict = nullptr; |
| 805 if (!val->GetAsDictionary(&dict)) | 805 if (!val.GetAsDictionary(&dict)) |
| 806 continue; | 806 continue; |
| 807 std::string str; | 807 std::string str; |
| 808 if (dict->GetString(key, &str) && str == value) { | 808 if (dict->GetString(key, &str) && str == value) { |
| 809 ret = dict; | 809 ret = dict; |
| 810 break; | 810 break; |
| 811 } | 811 } |
| 812 } | 812 } |
| 813 return ret; | 813 return ret; |
| 814 }; | 814 }; |
| 815 | 815 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 CheckAliasStatus::NOT_ALLOWED) | 946 CheckAliasStatus::NOT_ALLOWED) |
| 947 .is_available()); | 947 .is_available()); |
| 948 EXPECT_FALSE(extension_api | 948 EXPECT_FALSE(extension_api |
| 949 ->IsAvailable("pageAction", extension.get(), | 949 ->IsAvailable("pageAction", extension.get(), |
| 950 Feature::BLESSED_EXTENSION_CONTEXT, GURL(), | 950 Feature::BLESSED_EXTENSION_CONTEXT, GURL(), |
| 951 CheckAliasStatus::NOT_ALLOWED) | 951 CheckAliasStatus::NOT_ALLOWED) |
| 952 .is_available()); | 952 .is_available()); |
| 953 } | 953 } |
| 954 | 954 |
| 955 } // namespace extensions | 955 } // namespace extensions |
| OLD | NEW |