| 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 28 matching lines...) Expand all Loading... |
| 39 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 40 | 40 |
| 41 using content::BrowserThread; | 41 using content::BrowserThread; |
| 42 using content::DownloadId; | 42 using content::DownloadId; |
| 43 using content::DownloadItem; | 43 using content::DownloadItem; |
| 44 using content::NavigationController; | 44 using content::NavigationController; |
| 45 using content::DownloadUrlParameters; | 45 using content::DownloadUrlParameters; |
| 46 | 46 |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| 49 using extensions::Extension; |
| 50 |
| 49 // Key used to attach the Approval to the DownloadItem. | 51 // Key used to attach the Approval to the DownloadItem. |
| 50 const char kApprovalKey[] = "extensions.webstore_installer"; | 52 const char kApprovalKey[] = "extensions.webstore_installer"; |
| 51 | 53 |
| 52 const char kInvalidIdError[] = "Invalid id"; | 54 const char kInvalidIdError[] = "Invalid id"; |
| 53 const char kNoBrowserError[] = "No browser found"; | 55 const char kNoBrowserError[] = "No browser found"; |
| 54 const char kDownloadDirectoryError[] = "Could not create download directory"; | 56 const char kDownloadDirectoryError[] = "Could not create download directory"; |
| 55 const char kDownloadCanceledError[] = "Download canceled"; | 57 const char kDownloadCanceledError[] = "Download canceled"; |
| 56 const char kInstallCanceledError[] = "Install canceled"; | 58 const char kInstallCanceledError[] = "Install canceled"; |
| 57 const char kDownloadInterruptedError[] = "Download interrupted"; | 59 const char kDownloadInterruptedError[] = "Download interrupted"; |
| 58 const char kInvalidDownloadError[] = "Download was not a CRX"; | 60 const char kInvalidDownloadError[] = "Download was not a CRX"; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 322 } |
| 321 | 323 |
| 322 void WebstoreInstaller::ReportSuccess() { | 324 void WebstoreInstaller::ReportSuccess() { |
| 323 if (delegate_) { | 325 if (delegate_) { |
| 324 delegate_->OnExtensionInstallSuccess(id_); | 326 delegate_->OnExtensionInstallSuccess(id_); |
| 325 delegate_ = NULL; | 327 delegate_ = NULL; |
| 326 } | 328 } |
| 327 | 329 |
| 328 Release(); // Balanced in Start(). | 330 Release(); // Balanced in Start(). |
| 329 } | 331 } |
| OLD | NEW |