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

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

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 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 | Annotate | Revision Log
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/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // filename and when the download starts writing to it (think concurrently 119 // filename and when the download starts writing to it (think concurrently
120 // running sharded browser tests installing the same test file, for 120 // running sharded browser tests installing the same test file, for
121 // instance). 121 // instance).
122 std::string random_number = 122 std::string random_number =
123 base::Uint64ToString(base::RandGenerator(kuint16max)); 123 base::Uint64ToString(base::RandGenerator(kuint16max));
124 124
125 base::FilePath file = 125 base::FilePath file =
126 directory.AppendASCII(id + "_" + random_number + ".crx"); 126 directory.AppendASCII(id + "_" + random_number + ".crx");
127 127
128 int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL("")); 128 int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL(""));
129 if (uniquifier > 0) 129 if (uniquifier > 0) {
130 file = file.InsertBeforeExtensionASCII(StringPrintf(" (%d)", uniquifier)); 130 file = file.InsertBeforeExtensionASCII(
131 base::StringPrintf(" (%d)", uniquifier));
132 }
131 133
132 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 134 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
133 base::Bind(callback, file)); 135 base::Bind(callback, file));
134 } 136 }
135 137
136 } // namespace 138 } // namespace
137 139
138 namespace extensions { 140 namespace extensions {
139 141
140 void WebstoreInstaller::Delegate::OnExtensionDownloadStarted( 142 void WebstoreInstaller::Delegate::OnExtensionDownloadStarted(
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 void WebstoreInstaller::ReportSuccess() { 423 void WebstoreInstaller::ReportSuccess() {
422 if (delegate_) { 424 if (delegate_) {
423 delegate_->OnExtensionInstallSuccess(id_); 425 delegate_->OnExtensionInstallSuccess(id_);
424 delegate_ = NULL; 426 delegate_ = NULL;
425 } 427 }
426 428
427 Release(); // Balanced in Start(). 429 Release(); // Balanced in Start().
428 } 430 }
429 431
430 } // namespace extensions 432 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698