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

Side by Side Diff: chrome/browser/extensions/convert_web_app.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 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 "chrome/browser/extensions/convert_web_app.h" 5 #include "chrome/browser/extensions/convert_web_app.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return NULL; 95 return NULL;
96 } 96 }
97 97
98 base::ScopedTempDir temp_dir; 98 base::ScopedTempDir temp_dir;
99 if (!temp_dir.CreateUniqueTempDirUnderPath(install_temp_dir)) { 99 if (!temp_dir.CreateUniqueTempDirUnderPath(install_temp_dir)) {
100 LOG(ERROR) << "Could not create temporary directory."; 100 LOG(ERROR) << "Could not create temporary directory.";
101 return NULL; 101 return NULL;
102 } 102 }
103 103
104 // Create the manifest 104 // Create the manifest
105 scoped_ptr<base::DictionaryValue> root(new base::DictionaryValue); 105 std::unique_ptr<base::DictionaryValue> root(new base::DictionaryValue);
106 root->SetString(keys::kPublicKey, GenerateKey(web_app.app_url)); 106 root->SetString(keys::kPublicKey, GenerateKey(web_app.app_url));
107 root->SetString(keys::kName, base::UTF16ToUTF8(web_app.title)); 107 root->SetString(keys::kName, base::UTF16ToUTF8(web_app.title));
108 root->SetString(keys::kVersion, ConvertTimeToExtensionVersion(create_time)); 108 root->SetString(keys::kVersion, ConvertTimeToExtensionVersion(create_time));
109 root->SetString(keys::kDescription, base::UTF16ToUTF8(web_app.description)); 109 root->SetString(keys::kDescription, base::UTF16ToUTF8(web_app.description));
110 root->SetString(keys::kLaunchWebURL, web_app.app_url.spec()); 110 root->SetString(keys::kLaunchWebURL, web_app.app_url.spec());
111 if (web_app.generated_icon_color != SK_ColorTRANSPARENT) { 111 if (web_app.generated_icon_color != SK_ColorTRANSPARENT) {
112 root->SetString(keys::kAppIconColor, image_util::GenerateHexColorString( 112 root->SetString(keys::kAppIconColor, image_util::GenerateHexColorString(
113 web_app.generated_icon_color)); 113 web_app.generated_icon_color));
114 } 114 }
115 115
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (!extension.get()) { 180 if (!extension.get()) {
181 LOG(ERROR) << error; 181 LOG(ERROR) << error;
182 return NULL; 182 return NULL;
183 } 183 }
184 184
185 temp_dir.Take(); // The caller takes ownership of the directory. 185 temp_dir.Take(); // The caller takes ownership of the directory.
186 return extension; 186 return extension;
187 } 187 }
188 188
189 } // namespace extensions 189 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/convert_user_script_unittest.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698