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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 DownloadItem* item, net::Error error) { | 294 DownloadItem* item, net::Error error) { |
295 if (!item) { | 295 if (!item) { |
296 DCHECK_NE(net::OK, error); | 296 DCHECK_NE(net::OK, error); |
297 ReportFailure(net::ErrorToString(error), FAILURE_REASON_OTHER); | 297 ReportFailure(net::ErrorToString(error), FAILURE_REASON_OTHER); |
298 return; | 298 return; |
299 } | 299 } |
300 | 300 |
301 DCHECK_EQ(net::OK, error); | 301 DCHECK_EQ(net::OK, error); |
302 download_item_ = item; | 302 download_item_ = item; |
303 download_item_->AddObserver(this); | 303 download_item_->AddObserver(this); |
304 if (approval_.get()) | 304 if (approval_) |
305 download_item_->SetUserData(kApprovalKey, approval_.release()); | 305 download_item_->SetUserData(kApprovalKey, approval_.release()); |
306 if (delegate_) | 306 if (delegate_) |
307 delegate_->OnExtensionDownloadStarted(id_, download_item_); | 307 delegate_->OnExtensionDownloadStarted(id_, download_item_); |
308 } | 308 } |
309 | 309 |
310 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { | 310 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { |
311 CHECK_EQ(download_item_, download); | 311 CHECK_EQ(download_item_, download); |
312 | 312 |
313 switch (download->GetState()) { | 313 switch (download->GetState()) { |
314 case DownloadItem::CANCELLED: | 314 case DownloadItem::CANCELLED: |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 void WebstoreInstaller::ReportSuccess() { | 424 void WebstoreInstaller::ReportSuccess() { |
425 if (delegate_) { | 425 if (delegate_) { |
426 delegate_->OnExtensionInstallSuccess(id_); | 426 delegate_->OnExtensionInstallSuccess(id_); |
427 delegate_ = NULL; | 427 delegate_ = NULL; |
428 } | 428 } |
429 | 429 |
430 Release(); // Balanced in Start(). | 430 Release(); // Balanced in Start(). |
431 } | 431 } |
432 | 432 |
433 } // namespace extensions | 433 } // namespace extensions |
OLD | NEW |