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

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

Issue 9314037: Save As for content retrieved via POST works in most circumstances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 10 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DownloadSaveInfo save_info; 208 DownloadSaveInfo save_info;
209 save_info.file_path = file; 209 save_info.file_path = file;
210 210
211 // The download url for the given extension is contained in |download_url_|. 211 // The download url for the given extension is contained in |download_url_|.
212 // We will navigate the current tab to this url to start the download. The 212 // We will navigate the current tab to this url to start the download. The
213 // download system will then pass the crx to the CrxInstaller. 213 // download system will then pass the crx to the CrxInstaller.
214 download_util::RecordDownloadCount( 214 download_util::RecordDownloadCount(
215 download_util::INITIATED_BY_WEBSTORE_INSTALLER_COUNT); 215 download_util::INITIATED_BY_WEBSTORE_INSTALLER_COUNT);
216 profile_->GetDownloadManager()->DownloadUrl( 216 profile_->GetDownloadManager()->DownloadUrl(
217 download_url_, referrer, "", 217 download_url_, referrer, "",
218 false, save_info, controller_->GetWebContents()); 218 false, -1, save_info, controller_->GetWebContents());
219 } 219 }
220 220
221 void WebstoreInstaller::ReportFailure(const std::string& error) { 221 void WebstoreInstaller::ReportFailure(const std::string& error) {
222 if (delegate_) 222 if (delegate_)
223 delegate_->OnExtensionInstallFailure(id_, error); 223 delegate_->OnExtensionInstallFailure(id_, error);
224 224
225 Release(); // Balanced in Start(). 225 Release(); // Balanced in Start().
226 } 226 }
227 227
228 void WebstoreInstaller::ReportSuccess() { 228 void WebstoreInstaller::ReportSuccess() {
229 if (delegate_) 229 if (delegate_)
230 delegate_->OnExtensionInstallSuccess(id_); 230 delegate_->OnExtensionInstallSuccess(id_);
231 231
232 Release(); // Balanced in Start(). 232 Release(); // Balanced in Start().
233 } 233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698