| 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_constants.h" | 9 #include "chrome/common/extensions/extension_constants.h" |
| 10 #include "chrome/common/extensions/manifest_url_handler.h" | 10 #include "chrome/common/extensions/manifest_url_handler.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } // namespace | 78 } // namespace |
| 79 | 79 |
| 80 bool IsSyncable(const Extension* extension) { | 80 bool IsSyncable(const Extension* extension) { |
| 81 // TODO(akalin): Figure out if we need to allow some other types. | 81 // TODO(akalin): Figure out if we need to allow some other types. |
| 82 | 82 |
| 83 // Default apps are not synced because otherwise they will pollute profiles | 83 // Default apps are not synced because otherwise they will pollute profiles |
| 84 // that don't already have them. Specially, if a user doesn't have default | 84 // that don't already have them. Specially, if a user doesn't have default |
| 85 // apps, creates a new profile (which get default apps) and then enables sync | 85 // apps, creates a new profile (which get default apps) and then enables sync |
| 86 // for it, then their profile everywhere gets the default apps. | 86 // for it, then their profile everywhere gets the default apps. |
| 87 bool is_syncable = (extension->location() == Manifest::INTERNAL && | 87 bool is_syncable = (extension->location() == Manifest::INTERNAL && |
| 88 !extension->was_installed_by_default()); | 88 !extension->was_installed_by_default() && |
| 89 extension->is_syncable()); |
| 89 // Sync the chrome web store to maintain its position on the new tab page. | 90 // Sync the chrome web store to maintain its position on the new tab page. |
| 90 is_syncable |= (extension->id() == extension_misc::kWebStoreAppId); | 91 is_syncable |= (extension->id() == extension_misc::kWebStoreAppId); |
| 91 // Sync the chrome component app to maintain its position on the app list. | 92 // Sync the chrome component app to maintain its position on the app list. |
| 92 is_syncable |= (extension->id() == extension_misc::kChromeAppId); | 93 is_syncable |= (extension->id() == extension_misc::kChromeAppId); |
| 93 return is_syncable; | 94 return is_syncable; |
| 94 } | 95 } |
| 95 | 96 |
| 96 bool IsSyncableExtension(const Extension* extension) { | 97 bool IsSyncableExtension(const Extension* extension) { |
| 97 return GetSyncType(extension) == SYNC_TYPE_EXTENSION; | 98 return GetSyncType(extension) == SYNC_TYPE_EXTENSION; |
| 98 } | 99 } |
| 99 | 100 |
| 100 bool IsSyncableApp(const Extension* extension) { | 101 bool IsSyncableApp(const Extension* extension) { |
| 101 return GetSyncType(extension) == SYNC_TYPE_APP; | 102 return GetSyncType(extension) == SYNC_TYPE_APP; |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace sync_helper | 105 } // namespace sync_helper |
| 105 } // namespace extensions | 106 } // namespace extensions |
| OLD | NEW |