OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // Adds an extension that was depended on by another extension. | 84 // Adds an extension that was depended on by another extension. |
85 bool AddFromExtensionImport( | 85 bool AddFromExtensionImport( |
86 const std::string& id, | 86 const std::string& id, |
87 const GURL& update_url, | 87 const GURL& update_url, |
88 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install); | 88 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install); |
89 | 89 |
90 // Given an extension id and an update URL, schedule the extension | 90 // Given an extension id and an update URL, schedule the extension |
91 // to be fetched, installed, and activated. | 91 // to be fetched, installed, and activated. |
92 bool AddFromExternalUpdateUrl(const std::string& id, | 92 bool AddFromExternalUpdateUrl(const std::string& id, |
| 93 const std::string& install_parameter, |
93 const GURL& update_url, | 94 const GURL& update_url, |
94 Manifest::Location location, | 95 Manifest::Location location, |
95 int creation_flags, | 96 int creation_flags, |
96 bool mark_acknowledged); | 97 bool mark_acknowledged); |
97 | 98 |
98 // Add a pending extension record for an external CRX file. | 99 // Add a pending extension record for an external CRX file. |
99 // Return true if the CRX should be installed, false if an existing | 100 // Return true if the CRX should be installed, false if an existing |
100 // pending record overrides it. | 101 // pending record overrides it. |
101 bool AddFromExternalFile( | 102 bool AddFromExternalFile( |
102 const std::string& id, | 103 const std::string& id, |
103 Manifest::Location location, | 104 Manifest::Location location, |
104 const base::Version& version, | 105 const base::Version& version, |
105 int creation_flags, | 106 int creation_flags, |
106 bool mark_acknowledged); | 107 bool mark_acknowledged); |
107 | 108 |
108 // Get the list of pending IDs that should be installed from an update URL. | 109 // Get the list of pending IDs that should be installed from an update URL. |
109 // Pending extensions that will be installed from local files will not be | 110 // Pending extensions that will be installed from local files will not be |
110 // included in the set. | 111 // included in the set. |
111 void GetPendingIdsForUpdateCheck( | 112 void GetPendingIdsForUpdateCheck( |
112 std::list<std::string>* out_ids_for_update_check) const; | 113 std::list<std::string>* out_ids_for_update_check) const; |
113 | 114 |
114 private: | 115 private: |
115 typedef std::list<PendingExtensionInfo> PendingExtensionList; | 116 typedef std::list<PendingExtensionInfo> PendingExtensionList; |
116 | 117 |
117 // Assumes an extension with id |id| is not already installed. | 118 // Assumes an extension with id |id| is not already installed. |
118 // Return true if the extension was added. | 119 // Return true if the extension was added. |
119 bool AddExtensionImpl( | 120 bool AddExtensionImpl( |
120 const std::string& id, | 121 const std::string& id, |
| 122 const std::string& install_parameter, |
121 const GURL& update_url, | 123 const GURL& update_url, |
122 const base::Version& version, | 124 const base::Version& version, |
123 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, | 125 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, |
124 bool is_from_sync, | 126 bool is_from_sync, |
125 bool install_silently, | 127 bool install_silently, |
126 Manifest::Location install_source, | 128 Manifest::Location install_source, |
127 int creation_flags, | 129 int creation_flags, |
128 bool mark_acknowledged); | 130 bool mark_acknowledged); |
129 | 131 |
130 // Add a pending extension record directly. Used for unit tests that need | 132 // Add a pending extension record directly. Used for unit tests that need |
(...skipping 15 matching lines...) Expand all Loading... |
146 friend void SetupPendingExtensionManagerForTest( | 148 friend void SetupPendingExtensionManagerForTest( |
147 int count, const GURL& update_url, | 149 int count, const GURL& update_url, |
148 PendingExtensionManager* pending_extension_manager); | 150 PendingExtensionManager* pending_extension_manager); |
149 | 151 |
150 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager); | 152 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager); |
151 }; | 153 }; |
152 | 154 |
153 } // namespace extensions | 155 } // namespace extensions |
154 | 156 |
155 #endif // EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ | 157 #endif // EXTENSIONS_BROWSER_PENDING_EXTENSION_MANAGER_H_ |
OLD | NEW |