OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 bool ExtensionService::OnExternalExtensionUpdateUrlFound( | 195 bool ExtensionService::OnExternalExtensionUpdateUrlFound( |
196 const std::string& id, | 196 const std::string& id, |
197 const std::string& install_parameter, | 197 const std::string& install_parameter, |
198 const GURL& update_url, | 198 const GURL& update_url, |
199 Manifest::Location location, | 199 Manifest::Location location, |
200 int creation_flags, | 200 int creation_flags, |
201 bool mark_acknowledged) { | 201 bool mark_acknowledged) { |
202 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 202 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
203 CHECK(crx_file::id_util::IdIsValid(id)); | 203 CHECK(crx_file::id_util::IdIsValid(id)); |
204 | 204 |
205 if (Manifest::IsExternalLocation(location)) { | 205 // External extensions can be cached because they're the |
206 // same across users, but it's necessary to exclude kiosk apps because | |
207 // the kiosk apps should be constrained in the isolated kiosk session | |
208 // and should not be shared across. | |
not at google - send to devlin
2015/08/31 18:11:52
This comment isn't a complete sentence.
jennyz
2015/08/31 23:57:25
Done.
| |
209 if (Manifest::IsExternalLocation(location) && | |
210 !extensions::ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) { | |
not at google - send to devlin
2015/08/31 18:11:52
Without this change, does the test you added fail?
jennyz
2015/08/31 23:57:25
Yes, the test will fail since the cache write to a
jennyz
2015/09/01 16:53:09
Actually the tests passed now, since I have moved
| |
206 // All extensions that are not user specific can be cached. | 211 // All extensions that are not user specific can be cached. |
207 extensions::ExtensionsBrowserClient::Get()->GetExtensionCache() | 212 extensions::ExtensionsBrowserClient::Get()->GetExtensionCache() |
208 ->AllowCaching(id); | 213 ->AllowCaching(id); |
209 } | 214 } |
210 | 215 |
211 const Extension* extension = GetExtensionById(id, true); | 216 const Extension* extension = GetExtensionById(id, true); |
212 if (extension) { | 217 if (extension) { |
213 // Already installed. Skip this install if the current location has | 218 // Already installed. Skip this install if the current location has |
214 // higher priority than |location|. | 219 // higher priority than |location|. |
215 Manifest::Location current = extension->location(); | 220 Manifest::Location current = extension->location(); |
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2577 } | 2582 } |
2578 | 2583 |
2579 void ExtensionService::OnProfileDestructionStarted() { | 2584 void ExtensionService::OnProfileDestructionStarted() { |
2580 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2585 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2581 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2586 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2582 it != ids_to_unload.end(); | 2587 it != ids_to_unload.end(); |
2583 ++it) { | 2588 ++it) { |
2584 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2589 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2585 } | 2590 } |
2586 } | 2591 } |
OLD | NEW |