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_UNPACKED_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.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/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/extensions/app_host_installer.h" | |
15 | 16 |
16 class ExtensionService; | 17 class ExtensionService; |
17 | 18 |
18 namespace extensions { | 19 namespace extensions { |
19 | 20 |
20 class Extension; | 21 class Extension; |
21 class RequirementsChecker; | 22 class RequirementsChecker; |
22 | 23 |
23 // Installs and loads an unpacked extension. Because internal state needs to be | 24 // Installs and loads an unpacked extension. Because internal state needs to be |
24 // held about the instalation process, only one call to Load*() should be made | 25 // held about the instalation process, only one call to Load*() should be made |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 void GetAbsolutePath(); | 81 void GetAbsolutePath(); |
81 void CheckExtensionFileAccess(); | 82 void CheckExtensionFileAccess(); |
82 void LoadWithFileAccess(int flags); | 83 void LoadWithFileAccess(int flags); |
83 | 84 |
84 // Notify the frontend that there was an error loading an extension. | 85 // Notify the frontend that there was an error loading an extension. |
85 void ReportExtensionLoadError(const std::string& error); | 86 void ReportExtensionLoadError(const std::string& error); |
86 | 87 |
87 // Called when an unpacked extension has been loaded and installed. | 88 // Called when an unpacked extension has been loaded and installed. |
88 void OnLoaded(); | 89 void OnLoaded(); |
89 | 90 |
91 // Called when user commits to intalling an app. | |
92 void OnPromptAccepted(); | |
93 | |
94 // Runs on File thread. Ensures that App Host is installed, and then | |
benwells
2012/10/04 07:53:01
Nit: File -> FILE
huangs
2012/10/04 22:56:42
Done (for the file).
| |
95 // proceeds to post CompleteExtensionInstall(). | |
96 void BeginInstall(); | |
97 | |
98 // Callback function for AppHostInstaller. | |
99 void OnAppHostInstallation(bool success); | |
100 | |
101 // Runs on File thread. Installs the unpacked extension into the profile and | |
benwells
2012/10/04 07:53:01
Nit: File -> FILE
huangs
2012/10/04 22:56:42
Done.
| |
102 // notifies the frontend. | |
103 void CompleteInstall(); | |
104 | |
90 // Helper to get the Extension::CreateFlags for the installing extension. | 105 // Helper to get the Extension::CreateFlags for the installing extension. |
91 int GetFlags(); | 106 int GetFlags(); |
92 | 107 |
93 base::WeakPtr<ExtensionService> service_weak_; | 108 base::WeakPtr<ExtensionService> service_weak_; |
94 | 109 |
95 // The pathname of the directory to load from, which is an absolute path | 110 // The pathname of the directory to load from, which is an absolute path |
96 // after GetAbsolutePath has been called. | 111 // after GetAbsolutePath has been called. |
97 FilePath extension_path_; | 112 FilePath extension_path_; |
98 | 113 |
99 // If true and the extension contains plugins, we prompt the user before | 114 // If true and the extension contains plugins, we prompt the user before |
100 // loading. | 115 // loading. |
101 bool prompt_for_plugins_; | 116 bool prompt_for_plugins_; |
102 | 117 |
103 scoped_ptr<RequirementsChecker> requirements_checker_; | 118 scoped_ptr<RequirementsChecker> requirements_checker_; |
104 | 119 |
105 scoped_refptr<const Extension> extension_; | 120 scoped_refptr<const Extension> extension_; |
106 | 121 |
107 // Whether to require the extension installed to have a modern manifest | 122 // Whether to require the extension installed to have a modern manifest |
108 // version. | 123 // version. |
109 bool require_modern_manifest_version_; | 124 bool require_modern_manifest_version_; |
110 | 125 |
126 // Helper to install App Host. | |
127 AppHostInstaller app_host_installer_; | |
128 | |
111 DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller); | 129 DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller); |
112 }; | 130 }; |
113 | 131 |
114 } // namespace extensions | 132 } // namespace extensions |
115 | 133 |
116 #endif // CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ | 134 #endif // CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
OLD | NEW |