| 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 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/supports_user_data.h" | 14 #include "base/supports_user_data.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "base/version.h" | 16 #include "base/version.h" |
| 17 #include "chrome/browser/extensions/extension_install_prompt.h" | 17 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/download_interrupt_reasons.h" |
| 19 #include "content/public/browser/download_item.h" | 20 #include "content/public/browser/download_item.h" |
| 20 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 22 #include "extensions/common/manifest_handlers/shared_module_info.h" | 23 #include "extensions/common/manifest_handlers/shared_module_info.h" |
| 23 #include "net/base/net_errors.h" | |
| 24 #include "ui/gfx/image/image_skia.h" | 24 #include "ui/gfx/image/image_skia.h" |
| 25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 26 | 26 |
| 27 class Profile; | 27 class Profile; |
| 28 | 28 |
| 29 namespace base { | 29 namespace base { |
| 30 class FilePath; | 30 class FilePath; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 friend struct content::BrowserThread::DeleteOnThread< | 198 friend struct content::BrowserThread::DeleteOnThread< |
| 199 content::BrowserThread::UI>; | 199 content::BrowserThread::UI>; |
| 200 friend class base::DeleteHelper<WebstoreInstaller>; | 200 friend class base::DeleteHelper<WebstoreInstaller>; |
| 201 virtual ~WebstoreInstaller(); | 201 virtual ~WebstoreInstaller(); |
| 202 | 202 |
| 203 // Helper to get install URL. | 203 // Helper to get install URL. |
| 204 static GURL GetWebstoreInstallURL(const std::string& extension_id, | 204 static GURL GetWebstoreInstallURL(const std::string& extension_id, |
| 205 InstallSource source); | 205 InstallSource source); |
| 206 | 206 |
| 207 // DownloadManager::DownloadUrl callback. | 207 // DownloadManager::DownloadUrl callback. |
| 208 void OnDownloadStarted(content::DownloadItem* item, net::Error error); | 208 void OnDownloadStarted(content::DownloadItem* item, |
| 209 content::DownloadInterruptReason interrupt_reason); |
| 209 | 210 |
| 210 // DownloadItem::Observer implementation: | 211 // DownloadItem::Observer implementation: |
| 211 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 212 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 212 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 213 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 213 | 214 |
| 214 // Downloads next pending module in |pending_modules_|. | 215 // Downloads next pending module in |pending_modules_|. |
| 215 void DownloadNextPendingModule(); | 216 void DownloadNextPendingModule(); |
| 216 | 217 |
| 217 // Downloads and installs a single Crx with the given |extension_id|. | 218 // Downloads and installs a single Crx with the given |extension_id|. |
| 218 // This function is used for both the extension Crx and dependences. | 219 // This function is used for both the extension Crx and dependences. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 249 std::list<SharedModuleInfo::ImportInfo> pending_modules_; | 250 std::list<SharedModuleInfo::ImportInfo> pending_modules_; |
| 250 // Total extension modules we need download and install (the main module and | 251 // Total extension modules we need download and install (the main module and |
| 251 // depedences). | 252 // depedences). |
| 252 int total_modules_; | 253 int total_modules_; |
| 253 bool download_started_; | 254 bool download_started_; |
| 254 }; | 255 }; |
| 255 | 256 |
| 256 } // namespace extensions | 257 } // namespace extensions |
| 257 | 258 |
| 258 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 259 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| OLD | NEW |