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

Unified Diff: chrome/test/live_sync/live_sync_extension_helper.cc

Issue 7104072: Adding new extension sync integration tests. Also modified the way that profile (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed lint error - misplaced comma Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
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";
}

Powered by Google App Engine
This is Rietveld 408576698