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

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

Issue 115733007: Fix non-otr profile's file manager being launched in guest mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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/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 616bd0cfc1801f3bd045b675e4b7ab70c68840ad..71ced922f4ffd818cd39ce467cda3f604b8b12bc 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
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
+#include "base/command_line.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extension_system_factory.h"
@@ -12,6 +13,10 @@
#include "chrome/browser/ui/app_list/app_list_syncable_service.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/chromeos_switches.h"
+#endif
+
namespace app_list {
// static
@@ -51,6 +56,13 @@ void AppListSyncableServiceFactory::RegisterProfilePrefs(
content::BrowserContext* AppListSyncableServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
+#if defined(OS_CHROMEOS)
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kGuestSession)) {
+ Profile* profile = static_cast<Profile*>(context);
+ return profile->GetOffTheRecordProfile();
+ }
stevenjb 2013/12/26 22:34:17 Please add a comment for this. It would be even be
tbarzic 2013/12/27 22:35:38 Yep, I agree a helper function for handling guest
+#endif
return chrome::GetBrowserContextRedirectedInIncognito(context);
}

Powered by Google App Engine
This is Rietveld 408576698