| 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/values.h" | 14 #include "base/values.h" |
| 15 #include "content/public/browser/download_id.h" | 15 #include "content/public/browser/download_id.h" |
| 16 #include "content/public/browser/download_item.h" | 16 #include "content/public/browser/download_item.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
| 20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 21 | 21 |
| 22 class FilePath; | 22 class FilePath; |
| 23 class Profile; | 23 class Profile; |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 class NavigationController; | 26 class NavigationController; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace extensions { |
| 30 |
| 29 // Downloads and installs extensions from the web store. | 31 // Downloads and installs extensions from the web store. |
| 30 class WebstoreInstaller : public content::NotificationObserver, | 32 class WebstoreInstaller : public content::NotificationObserver, |
| 31 public content::DownloadItem::Observer, | 33 public content::DownloadItem::Observer, |
| 32 public base::RefCounted<WebstoreInstaller> { | 34 public base::RefCounted<WebstoreInstaller> { |
| 33 public: | 35 public: |
| 34 enum Flag { | 36 enum Flag { |
| 35 FLAG_NONE = 0, | 37 FLAG_NONE = 0, |
| 36 | 38 |
| 37 // Inline installs trigger slightly different behavior (install source | 39 // Inline installs trigger slightly different behavior (install source |
| 38 // is different, download referrers are the item's page in the gallery). | 40 // is different, download referrers are the item's page in the gallery). |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 std::string id_; | 154 std::string id_; |
| 153 // The DownloadItem is owned by the DownloadManager and is valid from when | 155 // The DownloadItem is owned by the DownloadManager and is valid from when |
| 154 // OnDownloadStarted is called (with no error) until the DownloadItem | 156 // OnDownloadStarted is called (with no error) until the DownloadItem |
| 155 // transitions to state REMOVING. | 157 // transitions to state REMOVING. |
| 156 content::DownloadItem* download_item_; | 158 content::DownloadItem* download_item_; |
| 157 int flags_; | 159 int flags_; |
| 158 scoped_ptr<Approval> approval_; | 160 scoped_ptr<Approval> approval_; |
| 159 GURL download_url_; | 161 GURL download_url_; |
| 160 }; | 162 }; |
| 161 | 163 |
| 164 } // namespace extensions |
| 165 |
| 162 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 166 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
| OLD | NEW |