Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: chrome/common/extensions/api/common_extension_api_unittest.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.cc ('k') | chrome/common/extensions/api/extension_action/action_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698