| 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/values.h" | 15 #include "base/values.h" |
| 15 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/download_id.h" | 17 #include "content/public/browser/download_id.h" |
| 17 #include "content/public/browser/download_item.h" | 18 #include "content/public/browser/download_item.h" |
| 18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 21 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 21 #include "googleurl/src/gurl.h" | |
| 22 | 23 |
| 23 class FilePath; | 24 class FilePath; |
| 24 class Profile; | 25 class Profile; |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 class NavigationController; | 28 class NavigationController; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace extensions { | 31 namespace extensions { |
| 31 | 32 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 50 const std::string& error) = 0; | 51 const std::string& error) = 0; |
| 51 | 52 |
| 52 protected: | 53 protected: |
| 53 virtual ~Delegate() {} | 54 virtual ~Delegate() {} |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 // Contains information about what parts of the extension install process can | 57 // Contains information about what parts of the extension install process can |
| 57 // be skipped or modified. If one of these is present, it means that a CRX | 58 // be skipped or modified. If one of these is present, it means that a CRX |
| 58 // download was initiated by WebstoreInstaller. The Approval instance should | 59 // download was initiated by WebstoreInstaller. The Approval instance should |
| 59 // be checked further for additional details. | 60 // be checked further for additional details. |
| 60 struct Approval : public content::DownloadItem::ExternalData { | 61 struct Approval : public base::SupportsUserData::Data { |
| 61 static scoped_ptr<Approval> CreateWithInstallPrompt(Profile* profile); | 62 static scoped_ptr<Approval> CreateWithInstallPrompt(Profile* profile); |
| 62 static scoped_ptr<Approval> CreateWithNoInstallPrompt( | 63 static scoped_ptr<Approval> CreateWithNoInstallPrompt( |
| 63 Profile* profile, | 64 Profile* profile, |
| 64 const std::string& extension_id, | 65 const std::string& extension_id, |
| 65 scoped_ptr<base::DictionaryValue> parsed_manifest); | 66 scoped_ptr<base::DictionaryValue> parsed_manifest); |
| 66 | 67 |
| 67 virtual ~Approval(); | 68 virtual ~Approval(); |
| 68 | 69 |
| 69 // The extension id that was approved for installation. | 70 // The extension id that was approved for installation. |
| 70 std::string extension_id; | 71 std::string extension_id; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // transitions to state REMOVING. | 162 // transitions to state REMOVING. |
| 162 content::DownloadItem* download_item_; | 163 content::DownloadItem* download_item_; |
| 163 int flags_; | 164 int flags_; |
| 164 scoped_ptr<Approval> approval_; | 165 scoped_ptr<Approval> approval_; |
| 165 GURL download_url_; | 166 GURL download_url_; |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 } // namespace extensions | 169 } // namespace extensions |
| 169 | 170 |
| 170 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 171 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| OLD | NEW |