| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |