OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 GetSyncDataListHelper(disabled_extensions_, filter, &sync_data_list); | 1631 GetSyncDataListHelper(disabled_extensions_, filter, &sync_data_list); |
1632 GetSyncDataListHelper(terminated_extensions_, filter, &sync_data_list); | 1632 GetSyncDataListHelper(terminated_extensions_, filter, &sync_data_list); |
1633 return sync_data_list; | 1633 return sync_data_list; |
1634 } | 1634 } |
1635 | 1635 |
1636 void ExtensionService::ProcessSyncData( | 1636 void ExtensionService::ProcessSyncData( |
1637 const ExtensionSyncData& extension_sync_data, | 1637 const ExtensionSyncData& extension_sync_data, |
1638 ExtensionFilter filter) { | 1638 ExtensionFilter filter) { |
1639 const std::string& id = extension_sync_data.id; | 1639 const std::string& id = extension_sync_data.id; |
1640 | 1640 |
| 1641 // If we have an app update for an extension, or vice versa, ignore it. |
| 1642 // |
| 1643 // This can happen if an app author publishes an update that is actually an |
| 1644 // extension, for example. |
| 1645 const Extension* extension_if_installed = |
| 1646 GetExtensionByIdInternal(id, true, true, true); |
| 1647 if (extension_if_installed && !filter(*extension_if_installed)) { |
| 1648 LOG(WARNING) << "Attempt to sync wrong type of extension for " << id; |
| 1649 return; |
| 1650 } |
| 1651 |
1641 // Handle uninstalls first. | 1652 // Handle uninstalls first. |
1642 if (extension_sync_data.uninstalled) { | 1653 if (extension_sync_data.uninstalled) { |
1643 std::string error; | 1654 std::string error; |
1644 if (!UninstallExtensionHelper(this, id)) { | 1655 if (!UninstallExtensionHelper(this, id)) { |
1645 LOG(WARNING) << "Could not uninstall extension " << id | 1656 LOG(WARNING) << "Could not uninstall extension " << id |
1646 << " for sync"; | 1657 << " for sync"; |
1647 } | 1658 } |
1648 return; | 1659 return; |
1649 } | 1660 } |
1650 | 1661 |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 | 2545 |
2535 ExtensionService::NaClModuleInfoList::iterator | 2546 ExtensionService::NaClModuleInfoList::iterator |
2536 ExtensionService::FindNaClModule(const GURL& url) { | 2547 ExtensionService::FindNaClModule(const GURL& url) { |
2537 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2548 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2538 iter != nacl_module_list_.end(); ++iter) { | 2549 iter != nacl_module_list_.end(); ++iter) { |
2539 if (iter->url == url) | 2550 if (iter->url == url) |
2540 return iter; | 2551 return iter; |
2541 } | 2552 } |
2542 return nacl_module_list_.end(); | 2553 return nacl_module_list_.end(); |
2543 } | 2554 } |
OLD | NEW |