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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 | 1582 |
1583 void ExtensionService::OnExtensionInstalled( | 1583 void ExtensionService::OnExtensionInstalled( |
1584 const Extension* extension, | 1584 const Extension* extension, |
1585 const syncer::StringOrdinal& page_ordinal, | 1585 const syncer::StringOrdinal& page_ordinal, |
1586 int install_flags) { | 1586 int install_flags) { |
1587 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1587 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1588 | 1588 |
1589 const std::string& id = extension->id(); | 1589 const std::string& id = extension->id(); |
1590 bool initial_enable = ShouldEnableOnInstall(extension); | 1590 bool initial_enable = ShouldEnableOnInstall(extension); |
1591 std::string install_parameter; | 1591 std::string install_parameter; |
1592 const extensions::PendingExtensionInfo* pending_extension_info = NULL; | 1592 const extensions::PendingExtensionInfo* pending_extension_info = |
1593 if ((pending_extension_info = pending_extension_manager()->GetById(id))) { | 1593 pending_extension_manager()->GetById(id); |
| 1594 if (pending_extension_info) { |
1594 if (!pending_extension_info->ShouldAllowInstall(extension)) { | 1595 if (!pending_extension_info->ShouldAllowInstall(extension)) { |
1595 pending_extension_manager()->Remove(id); | 1596 pending_extension_manager()->Remove(id); |
1596 | 1597 |
1597 LOG(WARNING) << "ShouldAllowInstall() returned false for " | 1598 LOG(WARNING) << "ShouldAllowInstall() returned false for " |
1598 << id << " of type " << extension->GetType() | 1599 << id << " of type " << extension->GetType() |
1599 << " and update URL " | 1600 << " and update URL " |
1600 << extensions::ManifestURL::GetUpdateURL(extension).spec() | 1601 << extensions::ManifestURL::GetUpdateURL(extension).spec() |
1601 << "; not installing"; | 1602 << "; not installing"; |
1602 | 1603 |
1603 // Delete the extension directory since we're not going to | 1604 // Delete the extension directory since we're not going to |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 } | 2344 } |
2344 | 2345 |
2345 void ExtensionService::OnProfileDestructionStarted() { | 2346 void ExtensionService::OnProfileDestructionStarted() { |
2346 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2347 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2347 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2348 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2348 it != ids_to_unload.end(); | 2349 it != ids_to_unload.end(); |
2349 ++it) { | 2350 ++it) { |
2350 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2351 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2351 } | 2352 } |
2352 } | 2353 } |
OLD | NEW |