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

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

Issue 10356052: Disable off-store extension installs by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: argh Created 8 years, 7 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (file.empty()) { 283 if (file.empty()) {
284 ReportFailure(kDownloadDirectoryError); 284 ReportFailure(kDownloadDirectoryError);
285 return; 285 return;
286 } 286 }
287 287
288 // TODO(mihaip): For inline installs, we pretend like the referrer is the 288 // TODO(mihaip): For inline installs, we pretend like the referrer is the
289 // gallery, even though this could be an inline install, in order to pass the 289 // gallery, even though this could be an inline install, in order to pass the
290 // checks in ExtensionService::IsDownloadFromGallery. We should instead pass 290 // checks in ExtensionService::IsDownloadFromGallery. We should instead pass
291 // the real referrer, track if this is an inline install in the whitelist 291 // the real referrer, track if this is an inline install in the whitelist
292 // entry and look that up when checking that this is a valid download. 292 // entry and look that up when checking that this is a valid download.
293 GURL referrer = controller_->GetActiveEntry()->GetURL(); 293 GURL referrer = GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + id_);
Mihai Parparita -not on Chrome 2012/05/12 00:15:45 For the sake of posterity, Aaron and I discussed t
294 if (flags_ & FLAG_INLINE_INSTALL)
295 referrer = GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + id_);
296 294
297 content::DownloadSaveInfo save_info; 295 content::DownloadSaveInfo save_info;
298 save_info.file_path = file; 296 save_info.file_path = file;
299 297
300 // The download url for the given extension is contained in |download_url_|. 298 // The download url for the given extension is contained in |download_url_|.
301 // We will navigate the current tab to this url to start the download. The 299 // We will navigate the current tab to this url to start the download. The
302 // download system will then pass the crx to the CrxInstaller. 300 // download system will then pass the crx to the CrxInstaller.
303 download_util::RecordDownloadSource( 301 download_util::RecordDownloadSource(
304 download_util::INITIATED_BY_WEBSTORE_INSTALLER); 302 download_util::INITIATED_BY_WEBSTORE_INSTALLER);
305 scoped_ptr<DownloadUrlParameters> params( 303 scoped_ptr<DownloadUrlParameters> params(
(...skipping 14 matching lines...) Expand all
320 } 318 }
321 319
322 void WebstoreInstaller::ReportSuccess() { 320 void WebstoreInstaller::ReportSuccess() {
323 if (delegate_) { 321 if (delegate_) {
324 delegate_->OnExtensionInstallSuccess(id_); 322 delegate_->OnExtensionInstallSuccess(id_);
325 delegate_ = NULL; 323 delegate_ = NULL;
326 } 324 }
327 325
328 Release(); // Balanced in Start(). 326 Release(); // Balanced in Start().
329 } 327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698