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) { |