| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 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 "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/download_id.h" | |
| 18 #include "content/public/browser/download_item.h" | 17 #include "content/public/browser/download_item.h" |
| 19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 21 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 22 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 23 | 22 |
| 24 class FilePath; | 23 class FilePath; |
| 25 class Profile; | 24 class Profile; |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // This does *not* transfer ownership of |directory|. | 136 // This does *not* transfer ownership of |directory|. |
| 138 static void SetDownloadDirectoryForTests(FilePath* directory); | 137 static void SetDownloadDirectoryForTests(FilePath* directory); |
| 139 | 138 |
| 140 private: | 139 private: |
| 141 friend struct content::BrowserThread::DeleteOnThread< | 140 friend struct content::BrowserThread::DeleteOnThread< |
| 142 content::BrowserThread::UI>; | 141 content::BrowserThread::UI>; |
| 143 friend class base::DeleteHelper<WebstoreInstaller>; | 142 friend class base::DeleteHelper<WebstoreInstaller>; |
| 144 virtual ~WebstoreInstaller(); | 143 virtual ~WebstoreInstaller(); |
| 145 | 144 |
| 146 // DownloadManager::DownloadUrl callback. | 145 // DownloadManager::DownloadUrl callback. |
| 147 void OnDownloadStarted(content::DownloadId id, net::Error error); | 146 void OnDownloadStarted(content::DownloadItem* item, net::Error error); |
| 148 | 147 |
| 149 // DownloadItem::Observer implementation: | 148 // DownloadItem::Observer implementation: |
| 150 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 149 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 151 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 150 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 152 | 151 |
| 153 // Starts downloading the extension to |file_path|. | 152 // Starts downloading the extension to |file_path|. |
| 154 void StartDownload(const FilePath& file_path); | 153 void StartDownload(const FilePath& file_path); |
| 155 | 154 |
| 156 // Reports an install |error| to the delegate for the given extension if this | 155 // Reports an install |error| to the delegate for the given extension if this |
| 157 // managed its installation. This also removes the associated PendingInstall. | 156 // managed its installation. This also removes the associated PendingInstall. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 170 // The DownloadItem is owned by the DownloadManager and is valid from when | 169 // The DownloadItem is owned by the DownloadManager and is valid from when |
| 171 // OnDownloadStarted is called (with no error) until OnDownloadDestroyed(). | 170 // OnDownloadStarted is called (with no error) until OnDownloadDestroyed(). |
| 172 content::DownloadItem* download_item_; | 171 content::DownloadItem* download_item_; |
| 173 scoped_ptr<Approval> approval_; | 172 scoped_ptr<Approval> approval_; |
| 174 GURL download_url_; | 173 GURL download_url_; |
| 175 }; | 174 }; |
| 176 | 175 |
| 177 } // namespace extensions | 176 } // namespace extensions |
| 178 | 177 |
| 179 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 178 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| OLD | NEW |