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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc

Issue 231793005: Use original context for AppListSyncableServiceFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
index db66cf882c699d0d30fbf1f710a4bd7497b3387f..09a6a80c0364ed7d0ced63d019033828b11e67d0 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
+++ b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
@@ -13,6 +13,10 @@
#include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#endif
+
namespace app_list {
// static
@@ -31,7 +35,12 @@ AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() {
KeyedService* AppListSyncableServiceFactory::BuildInstanceFor(
content::BrowserContext* browser_context) {
Profile* profile = static_cast<Profile*>(browser_context);
- VLOG(1) << "BuildServiceInstanceFor: " << profile->GetDebugName();
+#if defined(OS_CHROMEOS)
+ if (chromeos::ProfileHelper::IsSigninProfile(profile))
+ return NULL;
+#endif
+ VLOG(1) << "BuildInstanceFor: " << profile->GetDebugName()
+ << " (" << profile << ")";
return new AppListSyncableService(profile,
extensions::ExtensionSystem::Get(profile));
}
@@ -59,11 +68,8 @@ void AppListSyncableServiceFactory::RegisterProfilePrefs(
content::BrowserContext* AppListSyncableServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
- // In Guest session, off the record profile should not be redirected to the
- // original one.
- Profile* profile = static_cast<Profile*>(context);
- if (profile->IsGuestSession())
- return chrome::GetBrowserContextOwnInstanceInIncognito(context);
+ // This matches the logic in ExtensionSyncServiceFactory, which uses the
+ // orginal browser context.
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698