| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Inline installs trigger slightly different behavior (install source | 38 // Inline installs trigger slightly different behavior (install source |
| 39 // is different, download referrers are the item's page in the gallery). | 39 // is different, download referrers are the item's page in the gallery). |
| 40 FLAG_INLINE_INSTALL = 1 << 0 | 40 FLAG_INLINE_INSTALL = 1 << 0 |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class Delegate { | 43 class Delegate { |
| 44 public: | 44 public: |
| 45 virtual void OnExtensionInstallSuccess(const std::string& id) = 0; | 45 virtual void OnExtensionInstallSuccess(const std::string& id) = 0; |
| 46 virtual void OnExtensionInstallFailure(const std::string& id, | 46 virtual void OnExtensionInstallFailure(const std::string& id, |
| 47 const std::string& error) = 0; | 47 const std::string& error) = 0; |
| 48 |
| 49 protected: |
| 50 virtual ~Delegate() {} |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 // Contains information about what parts of the extension install process can | 53 // Contains information about what parts of the extension install process can |
| 51 // be skipped or modified. If one of these is present, it means that a CRX | 54 // be skipped or modified. If one of these is present, it means that a CRX |
| 52 // download was initiated by WebstoreInstaller. The Approval instance should | 55 // download was initiated by WebstoreInstaller. The Approval instance should |
| 53 // be checked further for additional details. | 56 // be checked further for additional details. |
| 54 struct Approval : public content::DownloadItem::ExternalData { | 57 struct Approval : public content::DownloadItem::ExternalData { |
| 55 static scoped_ptr<Approval> CreateWithInstallPrompt(Profile* profile); | 58 static scoped_ptr<Approval> CreateWithInstallPrompt(Profile* profile); |
| 56 static scoped_ptr<Approval> CreateWithNoInstallPrompt( | 59 static scoped_ptr<Approval> CreateWithNoInstallPrompt( |
| 57 Profile* profile, | 60 Profile* profile, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // The DownloadItem is owned by the DownloadManager and is valid from when | 151 // The DownloadItem is owned by the DownloadManager and is valid from when |
| 149 // OnDownloadStarted is called (with no error) until the DownloadItem | 152 // OnDownloadStarted is called (with no error) until the DownloadItem |
| 150 // transitions to state REMOVING. | 153 // transitions to state REMOVING. |
| 151 content::DownloadItem* download_item_; | 154 content::DownloadItem* download_item_; |
| 152 int flags_; | 155 int flags_; |
| 153 scoped_ptr<Approval> approval_; | 156 scoped_ptr<Approval> approval_; |
| 154 GURL download_url_; | 157 GURL download_url_; |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 160 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| OLD | NEW |