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

Unified Diff: chrome/browser/ui/webui/options2/manage_profile_handler2.cc

Issue 9432003: Disable multi-profile UI in managed mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 9 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/options2/browser_options_handler2.cc ('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/options2/manage_profile_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
index d371915cb7a775c05ec05ea24976c9e2b89b486c..d4013f0aec7ac5cd6676ec7a6594a621f1833d6c 100644
--- a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
+++ b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
@@ -11,6 +11,7 @@
#include "base/value_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/gaia_info_update_service.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_info_util.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/ui/webui/web_ui_util.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_ui.h"
#include "grit/generated_resources.h"
@@ -201,6 +203,10 @@ void ManageProfileHandler::SetProfileNameAndIcon(const ListValue* args) {
void ManageProfileHandler::DeleteProfile(const ListValue* args) {
DCHECK(args);
+ // This handler could have been called in managed mode, for example because
+ // the user fiddled with the web inspector. Silently return in this case.
+ if (!ProfileManager::IsMultipleProfilesEnabled())
+ return;
ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED);
« no previous file with comments | « chrome/browser/ui/webui/options2/browser_options_handler2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698