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_BUNDLE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public base::RefCountedThreadSafe<BundleInstaller> { | 44 public base::RefCountedThreadSafe<BundleInstaller> { |
45 public: | 45 public: |
46 // Auto approve or cancel the permission prompt. | 46 // Auto approve or cancel the permission prompt. |
47 static void SetAutoApproveForTesting(bool approve); | 47 static void SetAutoApproveForTesting(bool approve); |
48 | 48 |
49 class Delegate { | 49 class Delegate { |
50 public: | 50 public: |
51 virtual void OnBundleInstallApproved() {} | 51 virtual void OnBundleInstallApproved() {} |
52 virtual void OnBundleInstallCanceled(bool user_initiated) {} | 52 virtual void OnBundleInstallCanceled(bool user_initiated) {} |
53 virtual void OnBundleInstallCompleted() {} | 53 virtual void OnBundleInstallCompleted() {} |
| 54 |
| 55 protected: |
| 56 virtual ~Delegate() {} |
54 }; | 57 }; |
55 | 58 |
56 // Represents an individual member of the bundle. | 59 // Represents an individual member of the bundle. |
57 struct Item { | 60 struct Item { |
58 // Items are in the PENDING state until they've been installed, or the | 61 // Items are in the PENDING state until they've been installed, or the |
59 // install has failed or been canceled. | 62 // install has failed or been canceled. |
60 enum State { | 63 enum State { |
61 STATE_PENDING, | 64 STATE_PENDING, |
62 STATE_INSTALLED, | 65 STATE_INSTALLED, |
63 STATE_FAILED | 66 STATE_FAILED |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 scoped_ptr<ExtensionInstallPrompt> install_ui_; | 192 scoped_ptr<ExtensionInstallPrompt> install_ui_; |
190 | 193 |
191 Delegate* delegate_; | 194 Delegate* delegate_; |
192 | 195 |
193 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); | 196 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); |
194 }; | 197 }; |
195 | 198 |
196 } // namespace extensions | 199 } // namespace extensions |
197 | 200 |
198 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ | 201 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
OLD | NEW |