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