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