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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_test_util.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "chrome/browser/media_galleries/media_galleries_test_util.h" 5 #include "chrome/browser/media_galleries/media_galleries_test_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 27 matching lines...) Expand all
38 38
39 scoped_refptr<extensions::Extension> AddMediaGalleriesApp( 39 scoped_refptr<extensions::Extension> AddMediaGalleriesApp(
40 const std::string& name, 40 const std::string& name,
41 const std::vector<std::string>& media_galleries_permissions, 41 const std::vector<std::string>& media_galleries_permissions,
42 Profile* profile) { 42 Profile* profile) {
43 std::unique_ptr<base::DictionaryValue> manifest(new base::DictionaryValue); 43 std::unique_ptr<base::DictionaryValue> manifest(new base::DictionaryValue);
44 manifest->SetString(extensions::manifest_keys::kName, name); 44 manifest->SetString(extensions::manifest_keys::kName, name);
45 manifest->SetString(extensions::manifest_keys::kVersion, "0.1"); 45 manifest->SetString(extensions::manifest_keys::kVersion, "0.1");
46 manifest->SetInteger(extensions::manifest_keys::kManifestVersion, 2); 46 manifest->SetInteger(extensions::manifest_keys::kManifestVersion, 2);
47 base::ListValue* background_script_list = new base::ListValue; 47 base::ListValue* background_script_list = new base::ListValue;
48 background_script_list->Append(new base::StringValue("background.js")); 48 background_script_list->AppendString("background.js");
49 manifest->Set(extensions::manifest_keys::kPlatformAppBackgroundScripts, 49 manifest->Set(extensions::manifest_keys::kPlatformAppBackgroundScripts,
50 background_script_list); 50 background_script_list);
51 51
52 base::ListValue* permission_detail_list = new base::ListValue; 52 base::ListValue* permission_detail_list = new base::ListValue;
53 for (size_t i = 0; i < media_galleries_permissions.size(); i++) 53 for (size_t i = 0; i < media_galleries_permissions.size(); i++)
54 permission_detail_list->Append( 54 permission_detail_list->AppendString(media_galleries_permissions[i]);
55 new base::StringValue(media_galleries_permissions[i]));
56 base::DictionaryValue* media_galleries_permission = 55 base::DictionaryValue* media_galleries_permission =
57 new base::DictionaryValue(); 56 new base::DictionaryValue();
58 media_galleries_permission->Set("mediaGalleries", permission_detail_list); 57 media_galleries_permission->Set("mediaGalleries", permission_detail_list);
59 base::ListValue* permission_list = new base::ListValue; 58 base::ListValue* permission_list = new base::ListValue;
60 permission_list->Append(media_galleries_permission); 59 permission_list->Append(media_galleries_permission);
61 manifest->Set(extensions::manifest_keys::kPermissions, permission_list); 60 manifest->Set(extensions::manifest_keys::kPermissions, permission_list);
62 61
63 extensions::ExtensionPrefs* extension_prefs = 62 extensions::ExtensionPrefs* extension_prefs =
64 extensions::ExtensionPrefs::Get(profile); 63 extensions::ExtensionPrefs::Get(profile);
65 base::FilePath path = extension_prefs->install_directory().AppendASCII(name); 64 base::FilePath path = extension_prefs->install_directory().AppendASCII(name);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 216
218 base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir) { 217 base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir) {
219 #if defined(OS_WIN) 218 #if defined(OS_WIN)
220 return base::FilePath(FILE_PATH_LITERAL("C:\\")).AppendASCII(dir); 219 return base::FilePath(FILE_PATH_LITERAL("C:\\")).AppendASCII(dir);
221 #elif defined(OS_POSIX) 220 #elif defined(OS_POSIX)
222 return base::FilePath(FILE_PATH_LITERAL("/")).Append(dir); 221 return base::FilePath(FILE_PATH_LITERAL("/")).Append(dir);
223 #else 222 #else
224 NOTREACHED(); 223 NOTREACHED();
225 #endif 224 #endif
226 } 225 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer_unittest.cc ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698