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

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

Issue 10912183: Remove DownloadManager::GetDownloadItem in favor of GetDownload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return; 275 return;
276 } 276 }
277 277
278 CHECK(id.IsValid()); 278 CHECK(id.IsValid());
279 279
280 DownloadManager* download_manager = 280 DownloadManager* download_manager =
281 BrowserContext::GetDownloadManager(profile_); 281 BrowserContext::GetDownloadManager(profile_);
282 if (!download_manager) 282 if (!download_manager)
283 return; 283 return;
284 download_item_ = download_manager->GetDownload(id.local()); 284 download_item_ = download_manager->GetDownload(id.local());
285 // TODO(benjhayden): DCHECK(item && item->IsInProgress()) after investigating
286 // the relationship between net::OK and invalid id.
285 if (download_item_) { 287 if (download_item_) {
286 download_item_->AddObserver(this); 288 download_item_->AddObserver(this);
287 if (approval_.get()) 289 if (approval_.get())
288 download_item_->SetUserData(kApprovalKey, approval_.release()); 290 download_item_->SetUserData(kApprovalKey, approval_.release());
289 } 291 }
290 } 292 }
291 293
292 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { 294 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) {
293 CHECK_EQ(download_item_, download); 295 CHECK_EQ(download_item_, download);
294 296
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void WebstoreInstaller::ReportSuccess() { 366 void WebstoreInstaller::ReportSuccess() {
365 if (delegate_) { 367 if (delegate_) {
366 delegate_->OnExtensionInstallSuccess(id_); 368 delegate_->OnExtensionInstallSuccess(id_);
367 delegate_ = NULL; 369 delegate_ = NULL;
368 } 370 }
369 371
370 Release(); // Balanced in Start(). 372 Release(); // Balanced in Start().
371 } 373 }
372 374
373 } // namespace extensions 375 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api_unittest.cc ('k') | chrome/browser/plugins/plugin_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698