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" | 17 #include "content/public/browser/download_id.h" |
18 #include "content/public/browser/download_item.h" | 18 #include "content/public/browser/download_item.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 | 23 |
| 24 class ExtensionInstallDialog; |
24 class FilePath; | 25 class FilePath; |
25 class Profile; | 26 class Profile; |
26 | 27 |
27 namespace content { | 28 namespace content { |
28 class NavigationController; | 29 class NavigationController; |
29 } | 30 } |
30 | 31 |
31 namespace extensions { | 32 namespace extensions { |
32 | 33 |
33 // Downloads and installs extensions from the web store. | 34 // Downloads and installs extensions from the web store. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 // Whether to skip the install dialog once the extension has been downloaded | 97 // Whether to skip the install dialog once the extension has been downloaded |
97 // and unpacked. One reason this can be true is that in the normal webstore | 98 // and unpacked. One reason this can be true is that in the normal webstore |
98 // installation, the dialog is shown earlier, before any download is done, | 99 // installation, the dialog is shown earlier, before any download is done, |
99 // so there's no need to show it again. | 100 // so there's no need to show it again. |
100 bool skip_install_dialog; | 101 bool skip_install_dialog; |
101 | 102 |
102 // Whether we should record an oauth2 grant for the extensions. | 103 // Whether we should record an oauth2 grant for the extensions. |
103 bool record_oauth2_grant; | 104 bool record_oauth2_grant; |
104 | 105 |
| 106 // Used to show the confirm dialog. |
| 107 scoped_refptr<ExtensionInstallDialog> dialog_; |
| 108 |
105 private: | 109 private: |
106 Approval(); | 110 Approval(); |
107 }; | 111 }; |
108 | 112 |
109 // Gets the Approval associated with the |download|, or NULL if there's none. | 113 // Gets the Approval associated with the |download|, or NULL if there's none. |
110 // Note that the Approval is owned by |download|. | 114 // Note that the Approval is owned by |download|. |
111 static const Approval* GetAssociatedApproval( | 115 static const Approval* GetAssociatedApproval( |
112 const content::DownloadItem& download); | 116 const content::DownloadItem& download); |
113 | 117 |
114 // Creates a WebstoreInstaller for downloading and installing the extension | 118 // Creates a WebstoreInstaller for downloading and installing the extension |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // The DownloadItem is owned by the DownloadManager and is valid from when | 174 // The DownloadItem is owned by the DownloadManager and is valid from when |
171 // OnDownloadStarted is called (with no error) until OnDownloadDestroyed(). | 175 // OnDownloadStarted is called (with no error) until OnDownloadDestroyed(). |
172 content::DownloadItem* download_item_; | 176 content::DownloadItem* download_item_; |
173 scoped_ptr<Approval> approval_; | 177 scoped_ptr<Approval> approval_; |
174 GURL download_url_; | 178 GURL download_url_; |
175 }; | 179 }; |
176 | 180 |
177 } // namespace extensions | 181 } // namespace extensions |
178 | 182 |
179 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ | 183 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_H_ |
OLD | NEW |