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

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

Issue 355233002: Fix build when ENABLE_MANAGED_USERS is not defined (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/browser/ui/webui/options/create_profile_handler.cc
diff --git a/chrome/browser/ui/webui/options/create_profile_handler.cc b/chrome/browser/ui/webui/options/create_profile_handler.cc
index facc7f0054b23dbd8c8708035b146d20d17f8294..1c415249ab135fe5dd0700006a1e2b702bb9d50d 100644
--- a/chrome/browser/ui/webui/options/create_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/create_profile_handler.cc
@@ -14,18 +14,22 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profiles_state.h"
-#include "chrome/browser/supervised_user/supervised_user_registration_utility.h"
-#include "chrome/browser/supervised_user/supervised_user_service.h"
-#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
-#include "chrome/browser/supervised_user/supervised_user_sync_service.h"
-#include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/options/options_handlers_helper.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/web_ui.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(ENABLE_MANAGED_USERS)
+#include "chrome/browser/supervised_user/supervised_user_registration_utility.h"
+#include "chrome/browser/supervised_user/supervised_user_service.h"
+#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
+#include "chrome/browser/supervised_user/supervised_user_sync_service.h"
+#include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h"
+#endif
+
namespace options {
CreateProfileHandler::CreateProfileHandler()
@@ -89,6 +93,7 @@ void CreateProfileHandler::CreateProfile(const base::ListValue* args) {
}
if (supervised_user) {
+#if defined(ENABLE_MANAGED_USERS)
James Hawkins 2014/06/27 21:09:57 OK, you're not gonna like this. (At least) the we
mckev 2014/06/27 21:14:10 Haha, no worries at all. I'd be happy to assist i
if (!IsValidExistingSupervisedUserId(supervised_user_id))
return;
@@ -111,6 +116,9 @@ void CreateProfileHandler::CreateProfile(const base::ListValue* args) {
IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN));
}
}
+#else
+ DCHECK(false) << "Supervised users aren't enabled.";
+#endif
}
ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_DIALOG);
@@ -189,6 +197,7 @@ void CreateProfileHandler::RegisterSupervisedUser(
chrome::HostDesktopType desktop_type,
const std::string& supervised_user_id,
Profile* new_profile) {
+#if defined(ENABLE_MANAGED_USERS)
Bernhard Bauer 2014/06/30 16:04:19 We might also want to move this whole method (and
DCHECK_EQ(profile_path_being_created_.value(),
new_profile->GetPath().value());
@@ -207,6 +216,9 @@ void CreateProfileHandler::RegisterSupervisedUser(
create_shortcut,
desktop_type,
new_profile));
+#else
+ DCHECK(false) << "Supervised users aren't enabled.";
+#endif
}
void CreateProfileHandler::OnSupervisedUserRegistered(
@@ -320,8 +332,10 @@ void CreateProfileHandler::CancelProfileRegistration(bool user_initiated) {
RecordProfileCreationMetrics(Profile::CREATE_STATUS_CANCELED);
}
+#if defined(ENABLE_MANAGED_USERS)
DCHECK(supervised_user_registration_utility_.get());
supervised_user_registration_utility_.reset();
+#endif
DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
profile_creation_type_ = NO_CREATION_IN_PROGRESS;
@@ -408,6 +422,7 @@ std::string CreateProfileHandler::GetJavascriptMethodName(
bool CreateProfileHandler::IsValidExistingSupervisedUserId(
const std::string& existing_supervised_user_id) const {
+#if defined(ENABLE_MANAGED_USERS)
if (existing_supervised_user_id.empty())
return true;
@@ -427,6 +442,10 @@ bool CreateProfileHandler::IsValidExistingSupervisedUserId(
return false;
}
return true;
+#else
+ DCHECK(false) << "Supervised users aren't enabled.";
+ return false;
+#endif
}
} // namespace options

Powered by Google App Engine
This is Rietveld 408576698