Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: chrome/common/extensions/sync_helper.cc

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up file header Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } // namespace 75 } // namespace
76 76
77 bool IsSyncable(const Extension* extension) { 77 bool IsSyncable(const Extension* extension) {
78 // TODO(akalin): Figure out if we need to allow some other types. 78 // TODO(akalin): Figure out if we need to allow some other types.
79 79
80 // Default apps are not synced because otherwise they will pollute profiles 80 // Default apps are not synced because otherwise they will pollute profiles
81 // that don't already have them. Specially, if a user doesn't have default 81 // that don't already have them. Specially, if a user doesn't have default
82 // apps, creates a new profile (which get default apps) and then enables sync 82 // apps, creates a new profile (which get default apps) and then enables sync
83 // for it, then their profile everywhere gets the default apps. 83 // for it, then their profile everywhere gets the default apps.
84 bool is_syncable = (extension->location() == Manifest::INTERNAL && 84 bool is_syncable = (extension->location() == Manifest::INTERNAL &&
85 !extension->was_installed_by_default() && 85 !extension->was_installed_by_default());
86 !extension->is_ephemeral());
87 // Sync the chrome web store to maintain its position on the new tab page. 86 // Sync the chrome web store to maintain its position on the new tab page.
88 is_syncable |= (extension->id() == extension_misc::kWebStoreAppId); 87 is_syncable |= (extension->id() == extension_misc::kWebStoreAppId);
89 // Sync the chrome component app to maintain its position on the app list. 88 // Sync the chrome component app to maintain its position on the app list.
90 is_syncable |= (extension->id() == extension_misc::kChromeAppId); 89 is_syncable |= (extension->id() == extension_misc::kChromeAppId);
91 return is_syncable; 90 return is_syncable;
92 } 91 }
93 92
94 bool IsSyncableExtension(const Extension* extension) { 93 bool IsSyncableExtension(const Extension* extension) {
95 return GetSyncType(extension) == SYNC_TYPE_EXTENSION; 94 return GetSyncType(extension) == SYNC_TYPE_EXTENSION;
96 } 95 }
97 96
98 bool IsSyncableApp(const Extension* extension) { 97 bool IsSyncableApp(const Extension* extension) {
99 return GetSyncType(extension) == SYNC_TYPE_APP; 98 return GetSyncType(extension) == SYNC_TYPE_APP;
100 } 99 }
101 100
102 } // namespace sync_helper 101 } // namespace sync_helper
103 } // namespace extensions 102 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698