OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 new api::settings_private::PrefObject()); | 39 new api::settings_private::PrefObject()); |
40 pref_object->key = name; | 40 pref_object->key = name; |
41 pref_object->type = api::settings_private::PrefType::PREF_TYPE_LIST; | 41 pref_object->type = api::settings_private::PrefType::PREF_TYPE_LIST; |
42 | 42 |
43 base::ListValue* value = new base::ListValue(); | 43 base::ListValue* value = new base::ListValue(); |
44 for (auto& email : whitelisted_users_) { | 44 for (auto& email : whitelisted_users_) { |
45 value->AppendString(email); | 45 value->AppendString(email); |
46 } | 46 } |
47 pref_object->value.reset(value); | 47 pref_object->value.reset(value); |
48 | 48 |
49 return pref_object.Pass(); | 49 return pref_object; |
50 } | 50 } |
51 | 51 |
52 bool AppendToListCrosSetting(const std::string& pref_name, | 52 bool AppendToListCrosSetting(const std::string& pref_name, |
53 const base::Value& value) override { | 53 const base::Value& value) override { |
54 std::string email; | 54 std::string email; |
55 value.GetAsString(&email); | 55 value.GetAsString(&email); |
56 | 56 |
57 for (auto& user : whitelisted_users_) { | 57 for (auto& user : whitelisted_users_) { |
58 if (email == user) | 58 if (email == user) |
59 return false; | 59 return false; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, AddAndRemoveUsers) { | 158 IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, AddAndRemoveUsers) { |
159 EXPECT_TRUE(RunSubtest("addAndRemoveUsers")) << message_; | 159 EXPECT_TRUE(RunSubtest("addAndRemoveUsers")) << message_; |
160 } | 160 } |
161 | 161 |
162 IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, IsOwner) { | 162 IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, IsOwner) { |
163 EXPECT_TRUE(RunSubtest("isOwner")) << message_; | 163 EXPECT_TRUE(RunSubtest("isOwner")) << message_; |
164 } | 164 } |
165 #endif | 165 #endif |
166 | 166 |
167 } // namespace extensions | 167 } // namespace extensions |
OLD | NEW |