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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 167723002: Don't display multi-profile under Guest user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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 | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 60ed444d90336cad7ce2097462af82cde87da6e8..e92aeb82a33609e9e5a941354f1113e6f6b26454 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -136,21 +136,6 @@ using content::Referrer;
namespace options {
-namespace {
-
-bool ShouldShowMultiProfilesUserList(chrome::HostDesktopType desktop_type) {
-#if defined(OS_CHROMEOS)
- // On Chrome OS we use different UI for multi-profiles.
- return false;
-#else
- if (desktop_type != chrome::HOST_DESKTOP_TYPE_NATIVE)
- return false;
- return profiles::IsMultipleProfilesEnabled();
-#endif
-}
-
-} // namespace
-
BrowserOptionsHandler::BrowserOptionsHandler()
: page_initialized_(false),
template_url_service_(NULL),
@@ -563,7 +548,7 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
g_browser_process->profile_manager()->GetNumberOfProfiles() > 1);
#endif
- if (ShouldShowMultiProfilesUserList(helper::GetDesktopType(web_ui())))
+ if (ShouldShowMultiProfilesUserList())
values->Set("profilesInfo", GetProfilesInfoList().release());
values->SetBoolean("profileIsManaged",
@@ -941,6 +926,20 @@ bool BrowserOptionsHandler::ShouldShowSetDefaultBrowser() {
#endif
}
+bool BrowserOptionsHandler::ShouldShowMultiProfilesUserList() {
+#if defined(OS_CHROMEOS)
+ // On Chrome OS we use different UI for multi-profiles.
+ return false;
+#else
+ if (helper::GetDesktopType(web_ui()) != chrome::HOST_DESKTOP_TYPE_NATIVE)
+ return false;
+ Profile* profile = Profile::FromWebUI(web_ui());
+ if (profile->IsGuestSession())
+ return false;
+ return profiles::IsMultipleProfilesEnabled();
+#endif
+}
+
void BrowserOptionsHandler::UpdateDefaultBrowserState() {
#if defined(OS_MACOSX)
ShellIntegration::DefaultWebClientState state =
@@ -1189,7 +1188,7 @@ scoped_ptr<base::ListValue> BrowserOptionsHandler::GetProfilesInfoList() {
}
void BrowserOptionsHandler::SendProfilesInfo() {
- if (!ShouldShowMultiProfilesUserList(helper::GetDesktopType(web_ui())))
+ if (!ShouldShowMultiProfilesUserList())
return;
web_ui()->CallJavascriptFunction("BrowserOptions.setProfilesInfo",
*GetProfilesInfoList());
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698