Chromium Code Reviews| 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 #include "chrome/common/extensions/sync_helper.h" | 5 #include "chrome/common/extensions/sync_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 8 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
| 9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
| 10 #include "chrome/common/extensions/extension_constants.h" | 10 #include "chrome/common/extensions/extension_constants.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // approve synced extensions. | 34 // approve synced extensions. |
| 35 if (!ManifestURL::GetUpdateURL(extension).is_empty() && | 35 if (!ManifestURL::GetUpdateURL(extension).is_empty() && |
| 36 !ManifestURL::UpdatesFromGallery(extension)) { | 36 !ManifestURL::UpdatesFromGallery(extension)) { |
| 37 return SYNC_TYPE_NONE; | 37 return SYNC_TYPE_NONE; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Disallow extensions with native code plugins. | 40 // Disallow extensions with native code plugins. |
| 41 // | 41 // |
| 42 // TODO(akalin): Relax this restriction once we've put in UI to | 42 // TODO(akalin): Relax this restriction once we've put in UI to |
| 43 // approve synced extensions. | 43 // approve synced extensions. |
| 44 if (PluginInfo::HasPlugins(extension)) | 44 if (PluginInfo::HasPlugins(extension) || |
|
jln (very slow on Chromium)
2013/06/20 02:28:52
Shouldn't we patch HasPlugins() instead?
It would
Jeffrey Yasskin
2013/06/20 03:08:42
HasPlugins is used to control content settings (ht
| |
| 45 extension->HasAPIPermission(APIPermission::kPlugin)) | |
| 45 return SYNC_TYPE_NONE; | 46 return SYNC_TYPE_NONE; |
| 46 | 47 |
| 47 switch (extension->GetType()) { | 48 switch (extension->GetType()) { |
| 48 case Manifest::TYPE_EXTENSION: | 49 case Manifest::TYPE_EXTENSION: |
| 49 return SYNC_TYPE_EXTENSION; | 50 return SYNC_TYPE_EXTENSION; |
| 50 | 51 |
| 51 case Manifest::TYPE_USER_SCRIPT: | 52 case Manifest::TYPE_USER_SCRIPT: |
| 52 // We only want to sync user scripts with gallery update URLs. | 53 // We only want to sync user scripts with gallery update URLs. |
| 53 if (ManifestURL::UpdatesFromGallery(extension)) | 54 if (ManifestURL::UpdatesFromGallery(extension)) |
| 54 return SYNC_TYPE_EXTENSION; | 55 return SYNC_TYPE_EXTENSION; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 bool IsSyncableExtension(const Extension* extension) { | 90 bool IsSyncableExtension(const Extension* extension) { |
| 90 return GetSyncType(extension) == SYNC_TYPE_EXTENSION; | 91 return GetSyncType(extension) == SYNC_TYPE_EXTENSION; |
| 91 } | 92 } |
| 92 | 93 |
| 93 bool IsSyncableApp(const Extension* extension) { | 94 bool IsSyncableApp(const Extension* extension) { |
| 94 return GetSyncType(extension) == SYNC_TYPE_APP; | 95 return GetSyncType(extension) == SYNC_TYPE_APP; |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace sync_helper | 98 } // namespace sync_helper |
| 98 } // namespace extensions | 99 } // namespace extensions |
| OLD | NEW |