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

Unified Diff: chrome/browser/supervised_user/supervised_user_pref_store.cc

Issue 769153007: Managed bookmarks for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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/supervised_user/supervised_user_pref_store.cc
diff --git a/chrome/browser/supervised_user/supervised_user_pref_store.cc b/chrome/browser/supervised_user/supervised_user_pref_store.cc
index 7a27cada0c3cb3b0c5c71c52393a0d9f1d9029cc..e98bcb4cc8aaa1946dbabf1c20e8485a8840133f 100644
--- a/chrome/browser/supervised_user/supervised_user_pref_store.cc
+++ b/chrome/browser/supervised_user/supervised_user_pref_store.cc
@@ -7,15 +7,17 @@
#include <vector>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/prefs/pref_value_map.h"
#include "base/values.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
+#include "chrome/browser/supervised_user/supervised_user_bookmarks_handler.h"
#include "chrome/browser/supervised_user/supervised_user_constants.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-
-using base::FundamentalValue;
+#include "components/bookmarks/common/bookmark_pref_names.h"
namespace {
@@ -118,6 +120,15 @@ void SupervisedUserPrefStore::OnNewSettingsAvailable(
record_history ? IncognitoModePrefs::DISABLED
: IncognitoModePrefs::ENABLED);
}
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableSupervisedUserManagedBookmarksFolder)) {
+ // Reconstruct bookmarks from split settings.
+ prefs_->SetValue(
+ bookmarks::prefs::kSupervisedBookmarks,
+ SupervisedUserBookmarksHandler::BuildBookmarksTree(*settings)
+ .release());
+ }
}
if (!old_prefs) {

Powered by Google App Engine
This is Rietveld 408576698