| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 bool checked = true; | 209 bool checked = true; |
| 210 bool enabled = true; | 210 bool enabled = true; |
| 211 MenuItem::ContextList contexts; | 211 MenuItem::ContextList contexts; |
| 212 contexts.Add(MenuItem::PAGE); | 212 contexts.Add(MenuItem::PAGE); |
| 213 contexts.Add(MenuItem::SELECTION); | 213 contexts.Add(MenuItem::SELECTION); |
| 214 int contexts_value = 0; | 214 int contexts_value = 0; |
| 215 ASSERT_TRUE(contexts.ToValue()->GetAsInteger(&contexts_value)); | 215 ASSERT_TRUE(contexts.ToValue()->GetAsInteger(&contexts_value)); |
| 216 | 216 |
| 217 base::ListValue* document_url_patterns(new base::ListValue()); | 217 base::ListValue* document_url_patterns(new base::ListValue()); |
| 218 document_url_patterns->Append( | 218 document_url_patterns->Append( |
| 219 Value::CreateStringValue("http://www.google.com/*")); | 219 new base::StringValue("http://www.google.com/*")); |
| 220 document_url_patterns->Append( | 220 document_url_patterns->Append( |
| 221 Value::CreateStringValue("http://www.reddit.com/*")); | 221 new base::StringValue("http://www.reddit.com/*")); |
| 222 | 222 |
| 223 base::ListValue* target_url_patterns(new base::ListValue()); | 223 base::ListValue* target_url_patterns(new base::ListValue()); |
| 224 target_url_patterns->Append( | 224 target_url_patterns->Append( |
| 225 Value::CreateStringValue("http://www.yahoo.com/*")); | 225 new base::StringValue("http://www.yahoo.com/*")); |
| 226 target_url_patterns->Append( | 226 target_url_patterns->Append( |
| 227 Value::CreateStringValue("http://www.facebook.com/*")); | 227 new base::StringValue("http://www.facebook.com/*")); |
| 228 | 228 |
| 229 base::DictionaryValue value; | 229 base::DictionaryValue value; |
| 230 value.SetBoolean("incognito", incognito); | 230 value.SetBoolean("incognito", incognito); |
| 231 value.SetString("string_uid", std::string()); | 231 value.SetString("string_uid", std::string()); |
| 232 value.SetInteger("type", type); | 232 value.SetInteger("type", type); |
| 233 value.SetString("title", title); | 233 value.SetString("title", title); |
| 234 value.SetBoolean("checked", checked); | 234 value.SetBoolean("checked", checked); |
| 235 value.SetBoolean("enabled", enabled); | 235 value.SetBoolean("enabled", enabled); |
| 236 value.SetInteger("contexts", contexts_value); | 236 value.SetInteger("contexts", contexts_value); |
| 237 value.Set("document_url_patterns", document_url_patterns); | 237 value.Set("document_url_patterns", document_url_patterns); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); | 748 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); |
| 749 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 749 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 750 | 750 |
| 751 // Remove all context menu items with incognito true. | 751 // Remove all context menu items with incognito true. |
| 752 manager_.RemoveAllIncognitoContextItems(); | 752 manager_.RemoveAllIncognitoContextItems(); |
| 753 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); | 753 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); |
| 754 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 754 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 755 } | 755 } |
| 756 | 756 |
| 757 } // namespace extensions | 757 } // namespace extensions |
| OLD | NEW |