OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 3758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3769 return SYNC_TYPE_APP; | 3769 return SYNC_TYPE_APP; |
3770 | 3770 |
3771 default: | 3771 default: |
3772 return SYNC_TYPE_NONE; | 3772 return SYNC_TYPE_NONE; |
3773 } | 3773 } |
3774 } | 3774 } |
3775 | 3775 |
3776 bool Extension::IsSyncable() const { | 3776 bool Extension::IsSyncable() const { |
3777 // TODO(akalin): Figure out if we need to allow some other types. | 3777 // TODO(akalin): Figure out if we need to allow some other types. |
3778 | 3778 |
3779 // We want to sync any extensions that are internal and the chrome web store. | 3779 // Default apps are not synced because otherwise they will pollute profiles |
3780 return location() == Extension::INTERNAL || | 3780 // that don't already have them. Specially, if a user doesn't have default |
3781 id() == extension_misc::kWebStoreAppId; | 3781 // apps, creates a new profile (which get default apps) and then enables sync |
| 3782 // for it, then their profile everywhere gets the default apps. |
| 3783 bool is_syncable = (location() == Extension::INTERNAL && |
| 3784 !was_installed_by_default()); |
| 3785 // Sync the chrome web store to maintain its position on the new tab page. |
| 3786 is_syncable |= (id() == extension_misc::kWebStoreAppId); |
| 3787 return is_syncable; |
3782 } | 3788 } |
3783 | 3789 |
3784 bool Extension::ShouldDisplayInLauncher() const { | 3790 bool Extension::ShouldDisplayInLauncher() const { |
3785 // All apps should be displayed on the NTP except for the Cloud Print App. | 3791 // All apps should be displayed on the NTP except for the Cloud Print App. |
3786 return is_app() && id() != extension_misc::kCloudPrintAppId; | 3792 return is_app() && id() != extension_misc::kCloudPrintAppId; |
3787 } | 3793 } |
3788 | 3794 |
3789 bool Extension::InstallWarning::operator==(const InstallWarning& other) const { | 3795 bool Extension::InstallWarning::operator==(const InstallWarning& other) const { |
3790 return format == other.format && message == other.message; | 3796 return format == other.format && message == other.message; |
3791 } | 3797 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3943 | 3949 |
3944 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3950 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3945 const Extension* extension, | 3951 const Extension* extension, |
3946 const PermissionSet* permissions, | 3952 const PermissionSet* permissions, |
3947 Reason reason) | 3953 Reason reason) |
3948 : reason(reason), | 3954 : reason(reason), |
3949 extension(extension), | 3955 extension(extension), |
3950 permissions(permissions) {} | 3956 permissions(permissions) {} |
3951 | 3957 |
3952 } // namespace extensions | 3958 } // namespace extensions |
OLD | NEW |