Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| =================================================================== |
| --- chrome/browser/extensions/extension_service.cc (revision 107300) |
| +++ chrome/browser/extensions/extension_service.cc (working copy) |
| @@ -906,9 +906,12 @@ |
| SyncChange sync_change; |
| if (sync_bundle) { |
| - ExtensionSyncData extension_sync_data(*extension, |
| - IsExtensionEnabled(extension_id), |
| - IsIncognitoEnabled(extension_id)); |
| + ExtensionSyncData extension_sync_data( |
| + *extension, |
| + IsExtensionEnabled(extension_id), |
| + IsIncognitoEnabled(extension_id), |
| + IsNotificationsInitialSetupDone(extension_id), |
| + IsNotificationsDisabled(extension_id)); |
| sync_change = extension_sync_data.GetSyncChange(SyncChange::ACTION_DELETE); |
| } |
| @@ -1747,9 +1750,12 @@ |
| void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) { |
| SyncBundle* sync_bundle = GetSyncBundleForExtension(extension); |
| if (sync_bundle) { |
| - ExtensionSyncData extension_sync_data(extension, |
| - IsExtensionEnabled(extension.id()), |
| - IsIncognitoEnabled(extension.id())); |
| + ExtensionSyncData extension_sync_data( |
| + extension, |
| + IsExtensionEnabled(extension.id()), |
| + IsIncognitoEnabled(extension.id()), |
| + IsNotificationsInitialSetupDone(extension.id()), |
| + IsNotificationsDisabled(extension.id())); |
| SyncChangeList sync_change_list(1, extension_sync_data.GetSyncChange( |
| sync_bundle->HasExtensionId(extension.id()) ? |
| @@ -1912,7 +1918,9 @@ |
| sync_data_list->push_back( |
| ExtensionSyncData(extension, |
| IsExtensionEnabled(extension.id()), |
| - IsIncognitoEnabled(extension.id()))); |
| + IsIncognitoEnabled(extension.id()), |
| + IsNotificationsInitialSetupDone(extension.id()), |
| + IsNotificationsDisabled(extension.id()))); |
| } |
| } |
| } |
| @@ -2036,6 +2044,34 @@ |
| SyncExtensionChangeIfNeeded(*extension); |
| } |
| +bool ExtensionService::IsNotificationsInitialSetupDone( |
| + const std::string& extension_id) const { |
| + return extension_prefs_->IsNotificationsInitialSetupDone(extension_id); |
| +} |
| + |
| +void ExtensionService::SetNotificationsInitialSetupDone( |
| + const std::string& extension_id, |
| + bool value) { |
| + extension_prefs_->SetNotificationsInitialSetupDone(extension_id, value); |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
nit: probably not worth writing this into the pref
Munjal (Google)
2011/10/27 18:35:05
Done.
I have one question though - is it possible
asargent_no_longer_on_chrome
2011/10/27 19:49:41
A race condition is unlikely to happen - the way t
Munjal (Google)
2011/10/27 20:01:50
Great, good to know.
|
| + const Extension* extension = GetInstalledExtension(extension_id); |
| + if (extension) |
| + SyncExtensionChangeIfNeeded(*extension); |
| +} |
| + |
| +bool ExtensionService::IsNotificationsDisabled( |
| + const std::string& extension_id) const { |
| + return extension_prefs_->IsNotificationsDisabled(extension_id); |
| +} |
| + |
| +void ExtensionService::SetNotificationsDisabled( |
| + const std::string& extension_id, |
| + bool value) { |
| + extension_prefs_->SetNotificationsDisabled(extension_id, value); |
| + const Extension* extension = GetInstalledExtension(extension_id); |
| + if (extension) |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
same thing here about bailing out if the extension
Munjal (Google)
2011/10/27 18:35:05
Done.
|
| + SyncExtensionChangeIfNeeded(*extension); |
| +} |
| + |
| bool ExtensionService::CanCrossIncognito(const Extension* extension) { |
| // We allow the extension to see events and data from another profile iff it |
| // uses "spanning" behavior and it has incognito access. "split" mode |