Index: chrome/test/live_sync/live_sync_extension_helper.cc |
diff --git a/chrome/test/live_sync/live_sync_extension_helper.cc b/chrome/test/live_sync/live_sync_extension_helper.cc |
index dc260adee85c1b8a4bc97746b3f49397f2f7850a..f1bd6f6f158b82f3ec39bc1d8b4c3e435b30ceaf 100644 |
--- a/chrome/test/live_sync/live_sync_extension_helper.cc |
+++ b/chrome/test/live_sync/live_sync_extension_helper.cc |
@@ -48,6 +48,26 @@ void LiveSyncExtensionHelper::UninstallExtension( |
NameToId(name)); |
} |
+void LiveSyncExtensionHelper::EnableExtension(Profile* profile, |
+ const std::string& name) { |
+ profile->GetExtensionService()->EnableExtension(NameToId(name)); |
+} |
+ |
+void LiveSyncExtensionHelper::DisableExtension(Profile* profile, |
+ const std::string& name) { |
+ profile->GetExtensionService()->DisableExtension(NameToId(name)); |
+} |
+ |
+void LiveSyncExtensionHelper::IncognitoEnableExtension( |
+ Profile* profile, const std::string& name) { |
+ profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), true); |
+} |
+ |
+void LiveSyncExtensionHelper::IncognitoDisableExtension( |
+ Profile* profile, const std::string& name) { |
+ profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), false); |
+} |
+ |
bool LiveSyncExtensionHelper::IsExtensionPendingInstallForSync( |
Profile* profile, const std::string& id) const { |
const PendingExtensionManager* pending_extension_manager = |
@@ -100,7 +120,12 @@ LiveSyncExtensionHelper::ExtensionStateMap |
const ExtensionList* extensions = extension_service->extensions(); |
for (ExtensionList::const_iterator it = extensions->begin(); |
it != extensions->end(); ++it) { |
- extension_state_map[(*it)->id()] = ENABLED; |
+ extension_state_map[(*it)->id()].first = ENABLED; |
+ if (extension_service->IsIncognitoEnabled((*it)->id())) { |
+ extension_state_map[(*it)->id()].second = INCOGNITO_ENABLED; |
+ } else { |
+ extension_state_map[(*it)->id()].second = INCOGNITO_DISABLED; |
+ } |
VLOG(2) << "Extension " << (*it)->id() << " in profile " |
<< profile_debug_name << " is enabled"; |
} |
@@ -109,7 +134,12 @@ LiveSyncExtensionHelper::ExtensionStateMap |
extension_service->disabled_extensions(); |
for (ExtensionList::const_iterator it = disabled_extensions->begin(); |
it != disabled_extensions->end(); ++it) { |
- extension_state_map[(*it)->id()] = DISABLED; |
+ extension_state_map[(*it)->id()].first = DISABLED; |
+ if (extension_service->IsIncognitoEnabled((*it)->id())) { |
+ extension_state_map[(*it)->id()].second = INCOGNITO_ENABLED; |
+ } else { |
+ extension_state_map[(*it)->id()].second = INCOGNITO_DISABLED; |
+ } |
VLOG(2) << "Extension " << (*it)->id() << " in profile " |
<< profile_debug_name << " is disabled"; |
} |
@@ -119,7 +149,12 @@ LiveSyncExtensionHelper::ExtensionStateMap |
PendingExtensionManager::const_iterator it; |
for (it = pending_extension_manager->begin(); |
it != pending_extension_manager->end(); ++it) { |
- extension_state_map[it->first] = PENDING; |
+ extension_state_map[it->first].first = PENDING; |
+ if (extension_service->IsIncognitoEnabled(it->first)) { |
+ extension_state_map[it->first].second = INCOGNITO_ENABLED; |
+ } else { |
+ extension_state_map[it->first].second = INCOGNITO_DISABLED; |
+ } |
VLOG(2) << "Extension " << it->first << " in profile " |
<< profile_debug_name << " is pending"; |
} |